SasqChart
Home
Home
Chart Gallery
Thumbs
Bar Charts
Stacked Bar
Line Charts
Area Charts
Stacked Area
Pie Charts
Mixed Charts
Chart Styles
Axis Options
Layout Options
ASP.Net Tutorials
Base Example
DataSet Bind
WinForm Tutorials
Base Example
DataSet Bind
  Forums Login
Username:
Password:
 
Create account
Forget password?
 Who is Online

There are currently:
2 anonymous users online.

0 of 1,436 registered users online.

There have been 160299 Page Hits by 118876 users

 Search Forums

More search options


Dual Axis with vastly differing ranges

C# Example Code

{                
    chart.Theme = Theme.Oranges;
    chart.Series[0].Type = ChartType.Line;
    chart.Series[1].Type = ChartType.Line;
    chart.Series[0].Name = "Left Axis";
    chart.Series[1].Name = "Right Axis";
    chart.Series[1].Group = Series.AxisGroup.SecondGroup;
    chart.Legend.Visible=true;
    
    double v1 = 0.0;
    double v2 = -10000.0;
    for (int i=0; i<=100; i++)
    {
        double a = (i*2) * (Math.PI/180);
        v1 += Math.Abs(Math.Sin(a)) * 0.0001;
        v2 += Math.Abs(Math.Cos(a)) * 2500;
        
        chart.Series[0].Data.Add(new DataPoint(v1, i.ToString()));
        chart.Series[1].Data.Add(new DataPoint(v2, i.ToString()));
    }                        
}

ASP.Net C# Example

<%@ Register tagPrefix="SasqChart" Namespace="SasqChart" Assembly="SasqChart" %>
<%@ Page Language="C#" %>
<%@ Import Namespace="System.Drawing" %>
<%@ Import Namespace="System.Drawing.Drawing2D" %>
<%@ Import Namespace="System.Drawing.Imaging" %>
<HTML>
    <HEAD>
        <title>Simple C# SasqChart Example</title>
        <script runat="server">
            private void Page_Load(object sender, System.EventArgs e)		
            {                
                chart.Theme = Theme.Oranges;
                chart.Series[0].Type = ChartType.Line;
                chart.Series[1].Type = ChartType.Line;
                chart.Series[0].Name = "Left Axis";
                chart.Series[1].Name = "Right Axis";
                chart.Series[1].Group = Series.AxisGroup.SecondGroup;
                chart.Legend.Visible=true;
                
                double v1 = 0.0;
                double v2 = -10000.0;
                for (int i=0; i<=100; i++)
                {
                    double a = (i*2) * (Math.PI/180);
                    v1 += Math.Abs(Math.Sin(a)) * 0.0001;
                    v2 += Math.Abs(Math.Cos(a)) * 2500;
                    
                    chart.Series[0].Data.Add(new DataPoint(v1, i.ToString()));
                    chart.Series[1].Data.Add(new DataPoint(v2, i.ToString()));
                }                        
            }

        </script>
    </HEAD>
    <body>
        <SasqChart:WebChartControl id="chart" runat="server" width="600" height="400" />
    </body>
</HTML>