Hi Shenggang,
As I do not know which programming language you are using, I will use C#/Java in the followings. If you need me to translate the code to another programming language, please let me know.
For the FinanceChart, there are many y-axes (one of the main price chart, and one for each indicator charts). The y=axis labels normally are automatically determined by ChartDirector, although you can also use Axis.setLinearScale to specify the scale and labels.
One method to achieve the coloring is as follows;
FinanceChart c = new FinanceChart(....);
.... some code to configure the financial chart ....
// Add the main price chart
XYChart m = c.addMainChart(......);
// Assume you want to configure the y-axis in the main price chart
Axis yAxis = m.yAxis();
int labelColor = m.yZoneColor(336.2, 0x00cc00, 0xee0000);
yAxis.setLabelStyle("normal", 8, labelColor);
// Use a special text color (0xffffff) and grid line color (0xcc0000) for the label 336.2
yAxis.addMark(336.2, -1, "336.2").setMarkColor(0xcc0000, 0xffffff, 0xcc0000);
Hope this can help.
Regards
Peter Kwan |