|
FinanceChart: x axis labels overlap |
Posted by jcl on Nov-11-2015 17:13 |
|
When a finance chart is too small, the month labels overlap on the x axis. I have tried to fix this with setTickDensity(), but the tick density seems to have no effect on finance charts.
The first part of the code looks like this:
FinanceChart *c = new FinanceChart(CHART_WIDHT);
c->setMargins(40,0,40,36);
c->setAntiAlias(false);
c->addTitle(TopRight,"My title",8);
c->setData(...);
XYChart *mc = c->addMainChart(CHART_HEIGHT);
mc->setYAxisOnRight(false);
mc->xAxis()->setTickDensity(200,100); // has no effect!
How can I prevent overlapping month labels on a finance chart? I would like to display year labels only in that case, but the autoscaling switches to years too late. |
Re: FinanceChart: x axis labels overlap |
Posted by Peter Kwan on Nov-12-2015 07:08 |
|
Hi jcl,
For FinanceChart, please use FinanceChart.setDateLabelSpacing to control the label
spacing. The FinanceChart object will use this label spacing to configure the x-axis of all the
XYCharts (the main price charts and the indicator charts).
Hope this can help.
Regards
Peter Kwan |
|