Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
335
set icon size to larger size for one point in scatter chart
posted

I have a scatter chart in which I need to set the size of the icon of one particular point to a larger size. What is the best way to go about this? I will need to determine which point to make larger dynamically based on x & y value.

Parents
No Data
Reply
  • 2406
    posted

    Hi,

    You could achieve the desired behavior when add a new larger icon element over the desired point one using the FillSceneGraph event as follows:

    private void Form1_Load(object sender, EventArgs e)
    {
        ultraChart1.FillSceneGraph += new Infragistics.UltraChart.Shared.Events.FillSceneGraphEventHandler(ultraChart1_FillSceneGraph);
    }

    void ultraChart1_FillSceneGraph(object sender, Infragistics.UltraChart.Shared.Events.FillSceneGraphEventArgs e)
    {
        Symbol symbol = null;

        foreach (Primitive primitive in e.SceneGraph)
        {
            PointSet pointSet = primitive as PointSet;
            if (pointSet == null)
            {
                continue;
            }

            //get the desired point you want with different icon -> you could determine it based on x & y values
            DataPoint dataPoint = pointSet.points[0];

            //add a new icon with the desired settings over the point's default icon
            symbol = new Symbol(dataPoint.point, pointSet.icon, SymbolIconSize.Large);
        }

        if (symbol != null)
        {
            e.SceneGraph.Add(symbol);
        }
    }

Children