FlexChart: Binding to array element?

Posted by: hdle on 2 December 2024, 4:16 pm EST

    • Post Options:
    • Link

    Posted 2 December 2024, 4:16 pm EST

    Hi,

    Is it possible to bind a series to an array element instead of specific property name?

    Assume:

    DataPoint {
    	int X;
    	List<double> Values; // each entry is a different series
    }

    Is it possible to bind the series to a specific array index?

    Currently I am creating a list of DataPoint for each series. Is it better to create a single list of point, where each point can have an array of values, one for each series?

    Thanks,

    Hai

  • Posted 3 December 2024, 5:44 am EST

    Hello Hai,

    We are sorry, but it is not possible to bind the array values for each series directly in FlexChart.

    You can implement properties in your DataPointClass to refer to the array values as follows:

    class DataPointFC : DataPoint
    {
        public double Y1 => Values[0];
        public double Y2 => Values[1];
        public double Y3 => Values[2];
    }
    
    class DataPoint
    {
        public int X { get; set; }
        public List<double> Values { get; set; }
    }

    Please refer to the attached sample for implementation. (see FlexChart_Sample.zip)

    Regards,

    Uttkarsh.

  • Posted 3 December 2024, 11:08 am EST

    Uttkarsh,

    The number of series is query driven so I don’t know how many are available and cannot create a wrapper class as in your example. I’ll just stick with one collection per series.

    Thanks,

    Hai

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels