How can I make the Y axis or 2nd Y axis of the chart show only the maximum and minimum values?
The principle is very simple, that is, to set the interval of the Y axis to the maximum value of this axis, but interval does not support expression expressions to obtain the maximum value of the Y axis, so you need to write code in Dundas to implement it.
In the Dundas property settings window, select Advanced, click ViewCode, and select the postapplydata method from the drop-down list.CodeAs follows:
//Parameter: chartobj-represents the chart object
Chartobj. chartareas [0]. Axisy. Interval=
Chartobj. chartareas [ 0]. Axisy. Maximum-Chartobj. chartareas [0]. Axisy. Minimum;
Click the compile button. After compiled OK is displayed, the Code takes effect. Run report to see the effect.
If series groups is used to customize the color or maker type of each series?
When you use series groups in Dundas, each series added to Dundas will be displayed in groups based on this. The color of the grouped series is defined randomly by Dundas. To modify the color of the series or set its maker, you can also write code in Dundas.
In Dundas, each series has a default name, which is "Series 1" and "series 2. We only need to determine the name of each series separately and then use different settings. In the Dundas property settings window, select Advanced, click the viewcode button, and select the prepaint method from the drop-down list. The sample code of C # is as follows:// Parameter: chartobj-represents the chart object
// Parameter: sender-The chart object that will be painted
If(SenderIsSeries ){
Series = (Series) sender;
Switch (Series. Name ){
Case " Series 1 " :
Series. Color = color. lightyellow;
Series. markerstyle = Markerstyle. Diamond;
Break ;
Case " Series 2 " :
Series. Color = color. Red;
Series. markerstyle = Markerstyle. Square;
Break ;
}
}
Click the compile button. After compiled OK is displayed, the Code takes effect. Run report to see the effect.
If the sequence of series appears is not fixed, we can use legendtext to determine the sequence of series. The value of legendtext is the value of the Column Used for group in series groups. We can use switch (Series. legendtext) to determine.