in

C1 Community

ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

Zoom

Last post 06-27-2008 6:33 AM by alanis. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 06-25-2008 8:36 AM

    • alanis
    • Top 500 Contributor
    • Joined on 07-31-2006
    • Posts 9

    Zoom

     I would like to know if anyone ever implemented zooming in the webchart control. Did any do this and can provide me with a sample of script?

     

    Thanks,
    Ralph

    Filed under: ,
  • 06-26-2008 1:02 PM In reply to

    • C1_GregL
    • Top 10 Contributor
    • Joined on 06-11-2007
    • Pittsburgh PA
    • Posts 500

    Since C1WebChart renders as a simple image, the best way to do zooming is to manipulate the chart's axes on the server and reload the chart image.  You can check out the attached sample to see zooming and panning/translation in action.

    Regards,
    Greg L

    Filed under: ,
  • 06-27-2008 6:33 AM In reply to

    • alanis
    • Top 500 Contributor
    • Joined on 07-31-2006
    • Posts 9

    Re: Zoom

     Thanks for quick response and helpful sample!!

     

    To improve user experience I would like my user to able to click in the chart and get details about the position they click (information about all channels, average, spreads etc.).

     A server-side solution would be (but not working) :

       protected void C1WebChart1_Click(object sender, ImageClickEventArgs e)
        {
            Axis ax = C1WebChart1.ChartArea.AxisX;
            int SeriesOutput = 0;
            int PointOutput = 0;
            int DistanceOutput = 0;
            if (C1WebChart1.ChartGroups.Group0.CoordToPointIndex(e.X, e.Y, PlotElementEnum.Points, 1, ref PointOutput, ref DistanceOutput))
            {
                ax.Text = e.X + ", " + e.Y + " -> " + PointOutput;
            }
            else
            {
                ax.Text = "Conversion failed";
            }
        }

     

    This example does not return any 'good' points. When clicking in the chart it always return the maximum number of points for PointOutput. Outside the chart most of the clickpoints return 0.

     Am I doing something wrong?


    Thanks again!

    Filed under: ,
Page 1 of 1 (3 items)
Contact ComponentOne: 1.800.858.2739 ©1987-2008 ComponentOne LLC All Rights Reserved.