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 */
- VRueda asked 10 years ago
- You must login to post comments
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 😡
- VRueda answered 10 years ago
- Glad you found a solution! Also there is a long discussion on Creating RolloverMarkerTemplate and PointMarkerTemplates in code elsewhere on our forums. Hope this helps! Andrew
- You must login to post comments
Please login first to submit.