T O P I C R E V I E W |
rdc1997 |
Posted - 24 Jul 2016 : 10:31:36 Good day.
Is it possible to set the color of annotation text?
Example: When using a statement similar to:
this.AddAnnotation(SPCChartObjects.PRIMARY_CHART, 23, "XY");
can the foreground and/or the background color of XY be controlled?
If so, is it a global setting or can the attributes of each annotation be set individually?
Thank you. |
2 L A T E S T R E P L I E S (Newest First) |
rdc1997 |
Posted - 25 Jul 2016 : 12:17:08 Works great! Thanks. |
quinncurtis |
Posted - 25 Jul 2016 : 10:50:03 You can set the color of the annotation (each can be different) by adding this method to your chart defining class:
void AddAnnotation(int chart, int dataindex, String text, Color c) { int textindex = AddAnnotation(chart, dataindex, text); SPCChartObjects chartobj = (chart == SPCChartObjects.PRIMARY_CHART ? PrimaryChart : SecondaryChart); ChartText textobj = (ChartText)chartobj.AnnotationArray[textindex]; textobj.SetColor(c);
}
It calls the base class AddAnnotaion, and then sets the color of the resulting ChartText object to your specified color.
|
|
|