amcharts zeigt Wert in bar
Ich bin mit amCharts, und ich möchte zeigen Werte, die innerhalb bar
Dies ist, wie es im moment aussieht:
und ich möchte es wie folgt sein:
Dies ist mein code zum anzeigen der Tabelle:
AmCharts.ready(function() {
generateWidgetData('week');
//SERIAL CHART
chart = new AmCharts.AmSerialChart();
chart.dataProvider = graphData;
chart.categoryField = 'date';
chart.startDuration = 1;
chart.columnWidth = 0.60;
chart.dataDateFormat = 'YYYY-MM-DD';
chart.startEffect = 'easeInSine';
chart.stackType = 'regular';
//AXES
//category
var categoryAxis = chart.categoryAxis;
categoryAxis.parseDates = true;
categoryAxis.minPeriod = 'DD';
categoryAxis.plotAreaBorderAlpha = 0.01;
categoryAxis.labelRotation = 90;
categoryAxis.axisThickness = 0;
categoryAxis.stackType = 'regular';
categoryAxis.gridThickness = 0;
categoryAxis.inside = false;
//categoryAxis.gridPosition = 'start';
//categoryAxis.startDate = '2014-05-08';
//value
//in case you don't want to change default settings of value axis,
//you don't need to create it, as one value axis is created automatically.
//GRAPH
var graph = new AmCharts.AmGraph();
graph.maxColumns = 1;
graph.valueField = 'Self-entered';
graph.balloonText = '[[category]]: <b>[[value]]</b>';
graph.type = 'column';
graph.lineAlpha = 0;
graph.labelText = '[[value]]';
graph.fillAlphas = 0.8;
graph.stackType = 'regular';
chart.addGraph(graph);
graph.cornerRadiusTop = 8;
//CURSOR
var chartCursor = new AmCharts.ChartCursor();
chartCursor.cursorAlpha = 0;
chartCursor.zoomable = false;
chartCursor.categoryBalloonEnabled = false;
chart.addChartCursor(chartCursor);
chart.creditsPosition = 'top-right';
chart.write('stepschart');
});
Vielen Dank im Voraus.
Du musst angemeldet sein, um einen Kommentar abzugeben.
Ich behoben, so dass ich nach einer Antwort, vielleicht hilft es ja jemandem
es ist wirklich einfach, alles, was Sie tun müssen ist, fügen Sie 2 Zeilen code:
graph.labelText = '[[Wert]]'; //dies einfügen von Werten in Etiketten
graph.labelPosition = 'innerhalb'; //und mit diesem stellen wir unsere Aufkleber im bar
Hoffe, dies hilft jemandem, der auch tun müssen gleiche