SciChartĀ® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components

0
0

Hello guys!

May be its not the best place to ask this question, but i need your help šŸ˜

I want to make XyScatterRenderableSeries, with contorl template – simple ellipse

But i want to do this in source

Like this:
ControlTemplate ScatterTemplate = new ControlTemplate();
var ellipse = new FrameworkElementFactory(typeof(Ellipse));

        ellipse.SetValue(Ellipse.HeightProperty, 10);
        ellipse.SetValue(Ellipse.WidthProperty, 9);
        ellipse.SetValue(Ellipse.FillProperty, new SolidColorBrush(s.Color));
        ellipse.SetValue(Ellipse.StrokeProperty, new SolidColorBrush(s.Color));


        ChartControl.RenderableSeries[index] = new XyScatterRenderableSeries { PointMarkerTemplate = ScatterTemplate };

But now i have Argument Exception with HeightProperty/WidthProperty and Thikness

ellipse.SetValue(Ellipse.HeightProperty, 10);
ellipse.SetValue(Ellipse.WidthProperty, 9);
ellipse.SetValue(Ellipse.StrokeThicknessProperty, s.Thickness); /*new Thickness (s.Thickness) doesnt work to */

  • You must to post comments
0
0

I found the answer

        ControlTemplate ScatterTemplate = new ControlTemplate();
        var ellipse = new FrameworkElementFactory(typeof(Ellipse));

        ellipse.SetValue(Ellipse.HeightProperty, tmpInt);
        ellipse.SetValue(Ellipse.WidthProperty, tmpInt);
        ellipse.SetValue(Ellipse.FillProperty, new SolidColorBrush(s.Color));
        ellipse.SetValue(Ellipse.StrokeProperty, new SolidColorBrush(s.Color));
        ellipse.SetValue(Ellipse.StrokeThicknessProperty,(double)s.Thickness);
        ScatterTemplate.VisualTree = ellipse;

need to use only double, not int šŸ˜”

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.