|
Y-axis scale margin |
Posted by Cj Talas on Nov-04-2011 19:58 |
|
Hi Peter,
I am working on this chart (attached image) and i have 3 problems atm.
1) How can i make the top maximum y-axis scale have some space between the border, so that it wont be touching the top border
2) How can i make the minimum y-axis scale not touch the x-axis line.
Note: What im doing at the moment is im trying to make the fonts bigger.
3) Also for the volume, i dont want to display the 0 volume instead i want it to start at 20M. is there a way for me to remove the 0M?
Also as an additional question.
Supposed i want to get rid of the borders, is it possible? (im talking about the entire chart border itself.
Thank you very much in advance.
|
Re: Y-axis scale margin |
Posted by Peter Kwan on Nov-05-2011 01:14 |
|
Hi Cj Talas,
1 & 2) For the top and bottom labels on the right y-axis, I suggest you increase the y-axis margin. I assume you are using the FinanceChart object to create the chart. The code in this case is like (in C#/Java):
//This is your existing addMainChart line, modified to save the returned XYChart object
XYChart m = myFinanceChartObj.addMainChart(....);
//10 pixel margins on both ends of the main y-axis
m.yAxis().setMargin(10, 10);
3) To remove the 0M label, you may add a mark at y = 0 for the left y-axis. It is like:
//Add a mark at y = 0 with the space character
m.yAxis2().addMark(0, -1, " ").setMarkColor(Chart.Transparent, 0, 0);
For the "borders", are you referring to the plot area border? If you are using ChartDirector Ver 5, you may use FinanceChart.setPlotAreaBorder to set the border color to transparent.
//Run the code below before you add the main price chart
myFinanceChartObj.setPlotAreaBorder(Chart.Transparent, 2);
After removing the plot area border, you will have the top edge removed, but you can still see the left/right/bottom edges, which are actually the axes. To remove the axes stem, you may use Axis.setColors, like:
m.yAxis().setColors(Chart.Transparent, 0x000000, 0x000000, 0x000000);
Hope this can help.
Regards
Peter Kwan |
Re: Y-axis scale margin |
Posted by Cj Talas on Nov-08-2011 17:46 |
|
Hi Peter,
Thank you so much!
That worked like magic.
That was way so easy than what i have in mind.
|
|