ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  如何把thousand change to 万
Posted by tallhill@gmail.com on Apr-08-2017 08:41
如果目前 xAxis 显示的是 100M,如何改成10万 ?

  Re: 如何把thousand change to 万
Posted by Peter Kwan on Apr-11-2017 11:27
Hi tallhill,

ChartDirector will not automatically display x-axis labels as 100M. If this it displayed this way, it is probably because your code configures the labels to display this way. In this case, you can freely change your code to to display the labels as 10万. The exact details depend on how you display the x-axis labels as 100M in the first place.

Are you referring to the y-axis labels in the FinanceChart for display the trading volume?

The FinanceChart object automatically detects the magnitude of the volume data, and will select to use "K", "M" or "B" for thousands, millions and billions. The FinanceChart object is released in source code, so you can modify it to fit your own needs. For example, in the C++ edition of ChartDirector, the source code is in "FinanceChart.h", and the part the automatically configures the y-axis for volume data is:

double maxVol = ArrayMath(volData).maxValue();
const char *units[] = {"", "K", "M", "B"};
int unitIndex = sizeof(units) / sizeof(units[0]) - 1;
while ((unitIndex > 0) && (maxVol < pow(1000.0, unitIndex))) {
     unitIndex = unitIndex - 1;
}

deepCopy(m_volData, ArrayMath(volData).div(pow(1000.0, unitIndex)));
m_volUnit = units[unitIndex];

You can change the "", "K", "M", "B" to Chinese units and use the power of 10000.0 instead of 1000.0 in the code.

Hope this can help.

Regards
Peter Kwan

  Re: 如何把thousand change to 万
Posted by tallhill@gmail.com on Apr-11-2017 18:14
谢谢答复。
在Finance中修改了yAxis的unit,改成万,亿了。增加了中文字体,现在可以用了。