3D Charts

Winnovative control offers the possibility to rotate 3D charts.

Chart Type:
Rotate around X Axis: 
Rotate around Y Axis: 
Rotate around Z Axis: 

200 200 200 200 200 200 170 170 170 170 170 170 100 100 100 100 100 100 290 290 290 290 290 290 110 110 110 110 110 110 100 100 100 100 100 100 100 100 100 100 100 100 100 140 140 140 140 140 140 120 120 120 120 120 120 120 200 200 200 200 200 200 60 60 60 60 60 60 60 190 190 190 190 190 190 190 300 300 300 300 300 300 160 160 160 160 160 160 160 220 220 220 220 220 220 220 100 100 100 100 100 100 100 120 120 120 120 120 120 120 120 120 120 120 120 120 120 300 300 300 300 300 300 160 160 160 160 160 160 160 100 100 100 100 100 100 100 200 200 200 200 200 200 80 80 80 80 80 80 80 190 190 190 190 190 190 190 200 200 200 200 200 200 200 200 200 200 200 200 200 200 200 200 200 200 200 200 200 220 220 220 220 220 220 220 230 230 230 230 230 230 230 270 270 270 270 270 270 270 270 270 270 270 270 270 270 100 100 100 100 100 100 100 300 300 300 300 300 300 300 190 190 190 190 190 190 190 260 260 260 260 260 260 260 320 320 320 320 320 320 320

Source code

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            LoadChartType();
            WebChart1.DataSource = Winnovative.DataSources.GetTestData();
            WebChart1.ChartType = Winnovative.ChartType.Bars3D;
 
            LoadRotationDegrees();
            DdlRotateX.SelectedValue = WebChart1.Charts3D.RotateAxisX.ToString();
            DdlRotateY.SelectedValue = WebChart1.Charts3D.RotateAxisY.ToString();
            DdlRotateZ.SelectedValue = WebChart1.Charts3D.RotateAxisZ.ToString();
        }
    }
 
    protected void DdlChartType_SelectedIndexChanged(object sender, EventArgs e)
    {
        WebChart1.ChartType = (Winnovative.ChartType)Enum.Parse(typeof(Winnovative.ChartType), DdlChartType.SelectedValue);
 
        DdlRotateX.SelectedValue = WebChart1.Charts3D.RotateAxisX.ToString();
        DdlRotateY.SelectedValue = WebChart1.Charts3D.RotateAxisY.ToString();
        DdlRotateZ.SelectedValue = WebChart1.Charts3D.RotateAxisZ.ToString();
    }
 
    private void LoadChartType()
    {
        DdlChartType.Items.Clear();
 
        string[] types = Enum.GetNames(typeof(Winnovative.ChartType));
        for (int i = 0; i <= types.Length - 1; i++)
        {
            if (types[i].Contains("3D"))
            {
                DdlChartType.Items.Add(types[i]);
            }
        }
 
    }
 
    private void LoadRotationDegrees()
    {
        DdlRotateX.Items.Clear();
        for (int i = 0; i < 360; i = i + 5)
        {
            DdlRotateX.Items.Add(i.ToString());
        }
 
        DdlRotateY.Items.Clear();
        for (int i = 0; i < 360; i = i + 5)
        {
            DdlRotateY.Items.Add(i.ToString());
        }
 
        DdlRotateZ.Items.Clear();
        for (int i = 0; i < 360; i = i + 5)
        {
            DdlRotateZ.Items.Add(i.ToString());
        }
    }
 
    protected void DdlRotateX_SelectedIndexChanged(object sender, EventArgs e)
    {
        WebChart1.Charts3D.RotateAxisX = Convert.ToInt32(DdlRotateX.SelectedValue);
    }
 
    protected void DdlRotateY_SelectedIndexChanged(object sender, EventArgs e)
    {
        WebChart1.Charts3D.RotateAxisY = Convert.ToInt32(DdlRotateY.SelectedValue);
    }
 
    protected void DdlRotateZ_SelectedIndexChanged(object sender, EventArgs e)
    {
        WebChart1.Charts3D.RotateAxisZ = Convert.ToInt32(DdlRotateZ.SelectedValue);
    }