在上图中,150(y轴)上有2个数据点,日期相同,问题是2个数据点相互重叠,我需要分别显示它们,因此这两个点与2个日期x轴点重叠,而不是1个,请建议任何解决方案。
代码如下:
chartBP = new AmCharts.AmSerialChart();
chartBP.path = "../../js/amcharts/";
chartBP.dataDateFormat = "YYYY-MM-DD";
chartBP.dataProvider = bp_array;
chartBP.categoryField = "created_at";
var bpDateAxix = chartBP.categoryAxis;
bpDateAxix.parseDates = true;
bpDateAxix.minorGridEnabled = true;
bpDateAxix.axisColor = "#FF7418";
bpDateAxix.twoLineMode = true;
var bpValueAxis = new AmCharts.ValueAxis();
bpValueAxis.gridAlpha = 0.15;
chartBP.addValueAxis(bpValueAxis);
bpValueAxis.axisColor = "#FF6600";
bpValueAxis.title = "Blood Pressure ("+uom+")";
bpValueAxis.minimum = 0;
var sysGraph = new AmCharts.AmGraph();
sysGraph.valueAxis = bpValueAxis;
sysGraph.valueField = "systolic";
sysGraph.balloonText = "SYS:[[systolic]] "+uom+"<br><p style='font-size:9px;max-width:300px;
word-wrap: break-word;'>[[alert_text]]</p>";
sysGraph.bullet = "round";
sysGraph.colorField = "bullet_color";
sysGraph.lineColor = "#808080";
chartBP.addGraph(sysGraph);
var diaGraph = new AmCharts.AmGraph();
diaGraph.valueAxis = bpValueAxis;
diaGraph.valueField = "diastolic";
diaGraph.balloonText = "DIA:[[diastolic]] "+uom+"<br><p style='font-size:9px;max-width:300px;
word-wrap: break-word;'>[[alert_text]]</p>";
diaGraph.colorField = "bullet_color";
diaGraph.lineColor = "#808080";
diaGraph.bullet = "square";
chartBP.addGraph(diaGraph);
var chartScrollbar = new AmCharts.ChartScrollbar();
chartScrollbar.scrollbarHeight = 20;
chartScrollbar.color = "#000000";
chartScrollbar.dragIcon = "/amcharts/images/dragIconRoundSmall.svg";
chartScrollbar.dragIconHeight = 22;
chartScrollbar.dragIconWidth = 22;
chartBP.addChartScrollbar(chartScrollbar);
chartBP.write(elementId);
AmCharts.checkEmptyData(chartBP);
暂无答案!
目前还没有任何答案,快来回答吧!