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

Message ListMessage List     Post MessagePost Message

  Change shape of marks
Posted by Alexander on Aug-28-2017 21:36
Attachments:
Hello,

I add marks to show last values.
By default, marks have square shape.
How can I change shape of mark?

See example.
mark_shape.png

  Re: Change shape of marks
Posted by Alexander on Aug-28-2017 21:37
I add marks with code:

`chart.yAxis().addMark(...)`

  Re: Change shape of marks
Posted by Peter Kwan on Aug-29-2017 06:32
Hi Alexander,

Unluckily, the textbox cannot be created with the exact look in your image. The one I can get is of similar shape as in your image, but filled with color, like:

c.yAxis().addMark(300, -1, "<*block,valign=absmiddle*><*img=@LeftTriangle,color=00FF00,width=7,height=13*><*bgColor=00FF00*> ABC ");

(Because the shape has no border color, it cannot be filled with white, otherwise it is invisible against a white background.)

Regards
Peter Kwan

  Re: Change shape of marks
Posted by Alexander on Aug-29-2017 19:12
May be you know different way to get text block with unique shape, border color and text inside it?

  Re: Change shape of marks
Posted by Peter Kwan on Aug-30-2017 19:34
Hi Alexander,

There are two other methods I can think of. You may try to see if it works for you.

(a) You may try to add a scatter layer to the chart to provide scatter symbols. You can use a custom shape as the symbol by using DataSet.setDataSymbol4. You can attach a label to a text label to the symbol by using Layer.setDataLabelFormat / Layer.setDataLabelStyle and use TextBox.setAlignment to configure center alignment. You can then shift the symbol to the position you want by using DataSet.setSymbolOffset.

(b) You may try to add the polygon with text after completing the chart. With this method, after completing the chart (without the label), use BaseChart.makeChart3 to obtain the DrawArea object. Then use DrawArea.polygon to draw custom polygons and DrawArea.text to draw custom texts. As DrawArea uses pixel coordinates, you can use XYChart.getYCoor to convert the data coordinates to pixel coordinates, and use XYChart.getAbsOffsetY to adjust for the offset of the main chart inside the FinanceChart.

Regards
Peter Kwan