This question is locked. New answers and comments are not allowed.
Hi guys
I'm trying to color Markers in a Scatterchart depending on its coordinates (see attachement). The best way I can figure is to store the color in the model, say "markerColor". But an Action like this, doesn't seem to work:
So I gave the model three different X/Y Properties, a pair for each color red, yellow and green. Then I drew three different series in a ScatterChart.
But now each Object is drawn three times, once at the designated point and two times in the point 0/0, even if the other X/Y properties are null. (see Attachement).
Do I really have to make a Class for each Color i'd like to draw or is there another way to achieve this?
PS: I do already have the Code with the fixed bug to access the dataItem in a Template, i.e. in a Tooltip.
Thanks a lot.
I'm trying to color Markers in a Scatterchart depending on its coordinates (see attachement). The best way I can figure is to store the color in the model, say "markerColor". But an Action like this, doesn't seem to work:
public void Markers(ChartMarkersBuilder builder){ builder.Type(ChartMarkerShape.Circle); builder.Background("<#= dataItem.markerColor #>"); builder.Border(2, "<#= dataItem.markerColor #>", ChartDashType.Solid); builder.Visible(true);}@(Html.Telerik().Chart<FieldRisiko>() .Name("scatterMatrix") .Series(series => { series.Scatter(typeof(RisikoManagementMatrix.Models.ViewModels.FieldRisiko), "greenX", "greenY") .Labels(label) .Labels(true) .Markers(greenmarkers); series.Scatter(typeof(RisikoManagementMatrix.Models.ViewModels.FieldRisiko), "yellowX", "yellowY") .Labels(label) .Labels(true) .Markers(yellowmarkers); series.Scatter(typeof(RisikoManagementMatrix.Models.ViewModels.FieldRisiko), "redX", "redY") .Labels(label) .Labels(true) .Markers(redmarkers);
})But now each Object is drawn three times, once at the designated point and two times in the point 0/0, even if the other X/Y properties are null. (see Attachement).
Do I really have to make a Class for each Color i'd like to draw or is there another way to achieve this?
PS: I do already have the Code with the fixed bug to access the dataItem in a Template, i.e. in a Tooltip.
Thanks a lot.