Search code examples
jqueryasp.netchartsmschartmicrosoft-chart-controls

CursorX and Zoom property not found for Microsoft Chart control


bELOW IS my chart code for "Doughnut" chart.

   <asp:Chart ID="dntData" runat="server" Height="130px" Width="134px" Visible="false" OnLoad="dntbudget_Load" >
            <Series>
                <asp:Series  Name="Series1" ChartType="Doughnut" IsValueShownAsLabel="True" LabelForeColor="White" Font="Verdana,5pt">
                    <Points>
                    </Points>
                </asp:Series>

            </Series>
            <ChartAreas  >
                <asp:ChartArea Name="ChartArea1" Area3DStyle-Enable3D="True" >
                </asp:ChartArea>
            </ChartAreas>
        </asp:Chart>

I want to add zoom in zoom out. I tried to write below code but unable to find proerty "CursorX", also Unable to find property "ScaleView.Zoomed".

  dntData.ChartAreas[0].AxisX.ScaleView.Zoomed=true;  //'Zoomed' not found
  dntData.ChartAreas[0].CursorX.IsUserSelectionEnabled = true; //'CursorX' not found.

Please suggest how to resolve and achieve zoom in/zoom out in this 'Doughnut' chart.


Solution

  • It seems that you mixed up something. CursorX and AxisX are properties of the WinForms charts control and not available in the web-control.

    See also: http://msdn.microsoft.com/en-us/library/system.windows.forms.datavisualization.charting.chartarea.cursorx(v=vs.110).aspx

    My answer to your second question should help you here: https://stackoverflow.com/a/23034864/2753126

    Hope that helps.

    Best regards, Chris