[DevExpress Support Team: CLONED FROM T496322: Gauge Item - How to configure default scale and add custom ranges.]
great! Works fine…
Now, and about styles?
I can use "stylechooser", save… and use the selected style in gauges?
thanks!
We have closed this ticket because another page addresses its subject:
Gauge Dashboard Item - Add more gauges types and designs[DevExpress Support Team: CLONED FROM T496322: Gauge Item - How to configure default scale and add custom ranges.]
great! Works fine…
Now, and about styles?
I can use "stylechooser", save… and use the selected style in gauges?
thanks!
I am afraid I do not see a way to implement this functionality in the WinForms dashboard viewer control. I apologize for not being helpful this time.
but this way… for scales Works this way…
- I imagine style too…
private void dashboardViewer1_DashboardItemControlCreated(object sender, DevExpress.DashboardWin.DashboardItemControlEventArgs e) {
if (e.GaugeControl != null) {
UpdateGauge(e.GaugeControl);
}
}
private void dashboardViewer1_DashboardItemControlUpdated(object sender, DevExpress.DashboardWin.DashboardItemControlEventArgs e) {
if (e.GaugeControl != null) {
UpdateGauge(e.GaugeControl);
}
}
private static void UpdateGauge(GaugeControl gaugeControl) {
foreach (CircularGauge gauge in gaugeControl.Gauges) {
gauge.Scales[0].MaxValue = 100;
gauge.Scales[0].MajorTickCount = 6;
gauge.Scales[0].MajorTickmark.FormatString = "{0}";
gauge.Scales[0].Ranges.Add( CreateNewRange( 0, 20, Color.Red ) );
gauge.Scales[0].Ranges.Add(CreateNewRange(20, 60, Color.Yellow));
}
}
private static IRange CreateNewRange(int startValue, int endValue, Color color) {
IRange result = new ArcScaleRange();
result.AppearanceRange.ContentBrush = new SolidBrushObject(color);
result.StartValue = startValue;
result.EndValue = endValue;
result.StartThickness = 10f;
result.EndThickness = 10f;
return result;
end sub
In the T496322 example, we update scales settings directly. However, it will be necessary to use the StyleChooser control to change the style. I am afraid the StyleChooser control is not configured to be used with the DashboardGaugeControl displaying multiple gauges.
Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.