An extension to the SynchronizeScale property. Defines the scale
synchronization behavior of an axis.
For a list of all members of this type, see Axis.ScaleSync members.
Object Model
Inheritance Hierarchy
System.Object
System.Collections.CollectionBase
dotnetCHARTING.AxisCollection
dotnetCHARTING.Axis.ScaleSync
Syntax
Example
[C#] This sample demonstrates how to synchronize two axis scales.
<%@ Page Language="C#" Description="dotnetCHARTING Component" %> <%@ Register TagPrefix="dotnet" Namespace="dotnetCHARTING" Assembly="dotnetCHARTING"%> <%@ Import Namespace="System.Drawing" %> <%@ Import Namespace="System.Drawing.Drawing2D" %> <HTML> <HEAD> <TITLE>.netCHARTING Sample</TITLE> <script runat="server"> void Page_Load(Object sender,EventArgs e) { Chart.Type = ChartType.Combo;//Horizontal; Chart.Width = 600; Chart.Height = 350; Chart.TempDirectory = "temp"; Chart.Debug = true; Chart.Title = "Synchronizing two differnt axes."; // This sample demonstrates how to synchronize two axis scales. // The following code will synchronize the new axis with the default y axis. Axis newAxis = new Axis(); Chart.YAxis.SynchronizeScale.Add(newAxis); // *DYNAMIC DATA NOTE* // This sample uses random data to populate the chart. To populate // a chart with database data see the following resources: // - Classic samples folder // - Help File > Data Tutorials // - Sample: features/DataEngine.aspx SeriesCollection mySC = getRandomData(); // Change the values of elements to demonstrate ensure the axis scales would not be the same. mySC[0][0].YValue = 100; mySC[3][0].YValue = -100; // Specify the new axis for two of the series and add them to a different chart area. mySC[2].YAxis = newAxis; mySC[3].YAxis = newAxis; Chart.ExtraChartAreas.Add(new ChartArea(new SeriesCollection(mySC[2],mySC[3]))); // Add the random data. Chart.SeriesCollection.Add(mySC[0],mySC[1]); } SeriesCollection getRandomData() { SeriesCollection SC = new SeriesCollection(); Random myR = new Random(1); for(int a = 0; a < 4; a++) { Series s = new Series(); s.Name = "Series " + a; for(int b = 0; b < 4; b++) { Element e = new Element(); e.Name = "Element " + b; e.YValue = myR.Next(50); s.Elements.Add(e); } SC.Add(s); } // Set Different Colors for our Series SC[0].DefaultElement.Color = Color.FromArgb(49,255,49); SC[1].DefaultElement.Color = Color.FromArgb(255,255,0); SC[2].DefaultElement.Color = Color.FromArgb(255,99,49); SC[3].DefaultElement.Color = Color.FromArgb(0,156,255); return SC; } </script> </HEAD> <BODY> <DIV align="center"> <dotnet:Chart id="Chart" runat="server" Width="568px" Height="344px"> </dotnet:Chart> </DIV> </BODY> </HTML>
|
See Also
Axis.ScaleSync Members
| dotnetCHARTING Namespace
2002 - 2005 Webavail Productions Inc. & Corporate Web Solutions Ltd.. All Rights Reserved.