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

Message ListMessage List     Post MessagePost Message

  More whitespace below x-axis labels
Posted by dave on Jan-22-2023 05:41
Attachments:
hi Peter,
How can I add more whitespace below the x-axis labels of the finance chart?

(for example, below the "Nov 14" area of this chart)

Thanks!
finance_chart.png

  Re: More whitespace below x-axis labels
Posted by dave on Jan-22-2023 05:42
Actually, what I want to do, is add more whitespace, and an optional title (containing 1 or more lines).

Thanks!

  Re: More whitespace below x-axis labels
Posted by Peter Kwan on Jan-23-2023 09:46
Hi dave,

You would need to increase the bottom margin of the FinanceChart. The bottom text can be added as the bottom title of the FinanceChart. Alternatively, you can add the text as the x-axis title of the bottom indicator chart, in this case you also need to resize the bottom indicator chart.

It is like:

FinanceChart c = new FinanceChart(.....);

// Increase the bottom margin to reserve space for the bottom text
c.setMargins(40, 30, 40, 40);

// Use the following if you want to add the text as the bottom title to the FinanceChart.
c.addTitle(Chart.Bottom, "ABCD DEFG", "Arial Bold", 12);

... create FinanceChart as usual ...

// Assume this is the last indicator chart at the bottom
XYChart lastIndicator = c.addMomentum(75, 12, 0x0000ff);

// Use the following if you want to add the text as the x-axis title of the last indicator
lastIndicator.setSize(c.getWidth(), c.getHeight() + 20);
lastIndicator.xAxis().setTitle("1234 5678", "Arial Bold", 10);


Best Regards
Peter Kwan

  Re: More whitespace below x-axis labels
Posted by dave on Jan-23-2023 19:11
Thanks a bunch!