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

Message ListMessage List     Post MessagePost Message

  Set Line Width
Posted by dale on Jul-18-2011 13:29
Hello,

I have created a scrolling FinanceChart, and added a line plotted on the MainChart using addLineIndicator2.  How can I change the thickness of the line drawn on the MainChart?  I didn't see a method for doing this.

Thanks.

  Re: Set Line Width
Posted by Peter Kwan on Jul-19-2011 01:46
Hi dale,

May be you can try the Layer.setLineWidth API. For example, in C++:

Layer *layer = c->addLineIndicator2(.....);
layer->setLineWidth(2);   //set line width to 2 pixels

Hope this can help.

Regards
Peter Kwan

  Re: Set Line Width
Posted by dale on Jul-19-2011 05:10
Hi Peter,

Thanks.  I probably should have been able to figure that out myself.  I got a little confused on the pointers to the layers.  I was using the pointer to the FinanceChart, which did not show setLineWidth as an available method.  Then I figured out I needed to get the MainChart pointer, etc., to eventually be able to point to the layer.  Is there a document or example that shows some of the higher level design for the MainChart and FinanceChart, etc?  I had to figure it out by trial and error.  Maybe I missed where this is documented.

Thanks again,
Dale

  Re: Set Line Width
Posted by Peter Kwan on Jul-20-2011 02:42
Hi dale,

A very high level overview can be found in the "ChartDirector Object Model Overview" section. (You may look for "ChartDirector Object Model Overview" from the ChartDirector documentation.)

If you have a feature you need, one approach that may help to find the API to use is as follows:

(a) Quickly look through the sample charts to see if any chart has the feature you need. For example, for a line with a thicker line width, you can find the "Multi-Line Chart" sample code has this feature.

(b) Look at the sample code to find the API to use to produce the feature. In the above case, the API in the sample code is Layer.setLineWidth, where the "layer" object is the object that represents the LineLayer that contains the line.

(c) Look at the code that you are using to see if the object is available. For your case, it is natural to look for the API that adds the line, which is "FinanceChart.addLineIndicator2". You may use the ChartDirector documentation index to look up the documentation on "FinanceChart.addLineIndicator2". According to the documentation, it does return a LineLayer object, so this object can be used to control the line width.

Hope this can help.

Regards
Peter Kwan