正如你在下面的图片中看到的那样,我的最后一支蜡烛只有50%出现了,我很难找到设置,这将确保我可以完整地查看最后一支蜡烛
如果您查看RED中的最后一根蜡烛,您会看到轴从最后一根蜡烛的中点开始。如果将此与下面的蜡烛进行比较,则可以完全查看最后一根蜡烛
http://jsfiddle.net/amcharts/TLx2n/
关键图表和相关图表组件如下:
graph = new AmCharts.StockGraph();
graph.id = "Price";
graph.title="Main";
graph.valueAxis = 'v1';
graph.showHandOnHover= true;
graph.proCandlesticks= false;
graph.labels = true;
graph.balloonColor="#00000";
graph.comparable=true;
graph.openField="Open";
graph.highField="High";
graph.closeField="Close";
graph.valueField="Close";
graph.type='candlestick';
graph.fillAlphas= 0.7;
graph.lineThickness= 1;
graph.fillColors= '#CC0000';
graph.lineColor= '#CC0000';
graph.negativeFillColors= '#000000';
graph.negativeLineColor= '#000000';
graph.negativeLineAlpha= 1;
graph.negativeFillAlphas= 0.7;
graph.proCandlesticks= false;
var categoryAxis = chart.categoryAxis;
categoryAxis.axisAlpha = 1;
categoryAxis.groupToPeriods = ["DD", "WW","MM"];
categoryAxis.maxSeries=300;
categoryAxis.fillAlpha=.2;
categoryAxis.equalSpacing = true;
categoryAxis.parseDates = true;
categoryAxis.startOnAxis = true;
categoryAxis.gridAlpha = 0.5;
categoryAxis.minorGridAlpha = 0.07;
categoryAxis.axisColor = "#000000";
categoryAxis.axisHeight=25;
categoryAxis.inside=false;
categoryAxis.tickLength = 0;
categoryAxis.gridThickness = 0;
categoryAxis.minorGridEnabled=false;
categoryAxis.axisThickness=0;
categoryAxis.gridThickness=0;
Other properties that I am using are as follows:
1. ValueAxesSettings
inside:false,
autoMargins:true,
minorGridEnabled: false,
logarithmic: false,
treatZeroAs: 0,
axisAlpha: 1,
gridAlpha: 0,
fillAlpha: 0,
minorGridAlpha : 0.07,
gridColor: "#000000",
axisThickness: 1,
gridThickness : 1,
tickLength: 1,
minMaxMultiplier: 1
如果我没有明确表达完整可视化最后一根蜡烛的痛点或者没有提供足够的细节,请告诉我。请忽略代码中的任何语法错误,因为我使用的是其他语言编译器。
答案 0 :(得分:1)
最后一根蜡烛被切断的原因是你将startOnAxis
设置为true
,这意味着 - 我希望我的上一个和第一个类别在中间开始和结束。将其设置为false
。
请注意,在基于日期的类别轴上,仅当equalSpacing
设置为true
时,此设置才有效。 (如果您实际上不需要它,则禁用equalSpacing
也会禁用切断蜡烛)
作为旁注,看看你的代码,似乎你正在将串行和股票图表配置混合在一起。 ValueAxesSettings
是股票图表的一项功能,在序列图表上将被忽略。 groupToPeriods
,maxSeries
等也是如此。