416.467.9100 | Dundas Data Visualization | Login
Welcome Guest
This is the support page for the legacy Dundas Dashboard application. For assistance with the current Dundas BI application please click here.
Dashboard v5.0

This site makes extensive use of JavaScript.

Please enable JavaScript in your web browser and reload the page before proceeding.

Add a stripline to a chart

Hide navigation
RSS
Modified on Mon, 27 Jan 2014 02:59 PM Categorized as Script Library
&dw; Script LibraryPrevious

Use this script to a stripline to LineChart1 that is the average of the displayed data on Series[0].

Script

Tip: watch the how to video: Strip Line

// Initialize the storage to include 1 decimal place double avg = 0.0;

// Calculate the sum of all measure values currently displayed in the series for (int i = 0; i < LineChart1.Series[0].Points.Count; i++) {

avg += LineChart1.Series[0].Points[i].YValues[0]; }

// Calculate the arithmetic average of the series avg /= LineChart1.Series[0].Points.Count;

// Initialize a new set of StripLine properties DashboardNumericStripLineSettings dashboardNumericStripLineSettings = new DashboardNumericStripLineSettings();

// Set starting value where StripLine region is defined dashboardNumericStripLineSettings.StartValue = 0.0;

// Assign color to the StripLine region dashboardNumericStripLineSettings.Fill = new DashboardSolidColorBrush(Colors.Red);

// Assign the calculated average value as the StripLine endpoint on the axis dashboardNumericStripLineSettings.StripWidth = avg;

// Assign generated Stripline to display on the chart LineChart1.YAxes[0].Scales[0].StripLines.Clear(); LineChart1.YAxes[0].Scales[0].StripLines.Add(dashboardNumericStripLineSettings);

// Resulting StripLine will cover the entire region between // (dashboardNumericStripLineSettings.StartValue) to // (dashboardNumericStripLineSettings.StartValue + avg)





Related topics

About Dundas | Contact Us Follow us on Twitter! | Privacy Statement | Report Site Issues

Copyright © 2009-2014 Dundas Data Visualization, Inc.