设置 ColorField 不会更改 Telerik UI 中 ScatterLineSeries 的颜色 ASP.NET AJAX
Setting ColorField does not change colour of ScatterLineSeries in Telerik UI for ASP.NET AJAX
我正在尝试使 ScatterLineSeries 显示为所需的颜色,但它们从未设置为正确的颜色,而 Telerik 总是使用其默认颜色来绘制标记和线条。我用两种风格重写了我的代码,但都没有改变颜色。数据和标签按预期显示,只是颜色没有设置为所需的颜色。
我的代码在这里:
<telerik:RadHtmlChart runat="server" ID="TimelineChart" Width="100%" Height="100%" PlotArea-XAxis-AxisCrossingValue="0" PlotArea-YAxis-AxisCrossingValue="0">
<PlotArea>
<Series>
<telerik:ScatterLineSeries Name="Very High Risks" DataFieldX="Date" DataFieldY="vhr" MissingValues="Interpolate">
<TooltipsAppearance Color="White" DataFormatString="{1} Very High Vulnerabilities"></TooltipsAppearance>
<LabelsAppearance Visible="false">
</LabelsAppearance>
</telerik:ScatterLineSeries>
<telerik:ScatterLineSeries Name="High Risks" DataFieldX="Date" DataFieldY="hr" MissingValues="Interpolate" ColorField="Red">
<TooltipsAppearance Color="White" DataFormatString="{1} High Vulnerabilities"></TooltipsAppearance>
<LabelsAppearance Visible="false">
</LabelsAppearance>
</telerik:ScatterLineSeries>
<telerik:ScatterLineSeries Name="Medium Risks" DataFieldX="Date" DataFieldY="mr" MissingValues="Interpolate" ColorField="Orange">
<TooltipsAppearance Color="White" DataFormatString="{1} Medium Vulnerabilities"></TooltipsAppearance>
<LabelsAppearance Visible="false">
</LabelsAppearance>
</telerik:ScatterLineSeries>
<telerik:ScatterLineSeries Name="Low Risks" DataFieldX="Date" DataFieldY="mr" MissingValues="Interpolate" ColorField="Yellow">
<TooltipsAppearance Color="White" DataFormatString="{1} Low Vulnerabilities"></TooltipsAppearance>
<LabelsAppearance Visible="false">
</LabelsAppearance>
</telerik:ScatterLineSeries>
<telerik:ScatterLineSeries Name="Information Level" DataFieldX="Date" DataFieldY="info" MissingValues="Interpolate" ColorField="Green">
<TooltipsAppearance Color="White" DataFormatString="{1} Information Level Findings"></TooltipsAppearance>
<LabelsAppearance Visible="false">
</LabelsAppearance>
</telerik:ScatterLineSeries>
</Series>
<XAxis BaseUnit="Days" AxisCrossingValue="0" Color="#b3b3b3" MajorTickType="Outside" MinorTickType="Outside" DataLabelsField="d" Type="Date">
<LabelsAppearance RotationAngle="0" DataFormatString="M/d/yyyy"></LabelsAppearance>
<MajorGridLines Color="#EFEFEF"></MajorGridLines>
<MinorGridLines Color="#F7F7F7"></MinorGridLines>
<TitleAppearance Position="Center" Text="Date"></TitleAppearance>
</XAxis>
<YAxis Color="#b3b3b3" MajorTickSize="1" MajorTickType="Outside" MinValue="0" MinorTickSize="1" MinorTickType="Outside">
<LabelsAppearance DataFormatString="{0}" RotationAngle="0"></LabelsAppearance>
<MajorGridLines Color="#EFEFEF" Width="1"></MajorGridLines>
<MinorGridLines Color="#F7F7F7" Width="1"></MinorGridLines>
<TitleAppearance Position="Center" Text="Number of Items"></TitleAppearance>
</YAxis>
</PlotArea>
<ChartTitle Text=""></ChartTitle>
<Legend>
<Appearance Position="Bottom"></Appearance>
</Legend>
</telerik:RadHtmlChart>
这是颜色错误的图表截图:
如有任何想法,我们将不胜感激。我到处搜索以寻找解决方案,我再次重写了之前的代码,以便直接在 .aspx 页面上设置色域,但它仍然什么也没做。
您必须设置[系列类型]。Appearance.FillStyle.BackgroundColor 才能更改线条的颜色,并且根本不使用 ColorField!
我正在尝试使 ScatterLineSeries 显示为所需的颜色,但它们从未设置为正确的颜色,而 Telerik 总是使用其默认颜色来绘制标记和线条。我用两种风格重写了我的代码,但都没有改变颜色。数据和标签按预期显示,只是颜色没有设置为所需的颜色。
我的代码在这里:
<telerik:RadHtmlChart runat="server" ID="TimelineChart" Width="100%" Height="100%" PlotArea-XAxis-AxisCrossingValue="0" PlotArea-YAxis-AxisCrossingValue="0">
<PlotArea>
<Series>
<telerik:ScatterLineSeries Name="Very High Risks" DataFieldX="Date" DataFieldY="vhr" MissingValues="Interpolate">
<TooltipsAppearance Color="White" DataFormatString="{1} Very High Vulnerabilities"></TooltipsAppearance>
<LabelsAppearance Visible="false">
</LabelsAppearance>
</telerik:ScatterLineSeries>
<telerik:ScatterLineSeries Name="High Risks" DataFieldX="Date" DataFieldY="hr" MissingValues="Interpolate" ColorField="Red">
<TooltipsAppearance Color="White" DataFormatString="{1} High Vulnerabilities"></TooltipsAppearance>
<LabelsAppearance Visible="false">
</LabelsAppearance>
</telerik:ScatterLineSeries>
<telerik:ScatterLineSeries Name="Medium Risks" DataFieldX="Date" DataFieldY="mr" MissingValues="Interpolate" ColorField="Orange">
<TooltipsAppearance Color="White" DataFormatString="{1} Medium Vulnerabilities"></TooltipsAppearance>
<LabelsAppearance Visible="false">
</LabelsAppearance>
</telerik:ScatterLineSeries>
<telerik:ScatterLineSeries Name="Low Risks" DataFieldX="Date" DataFieldY="mr" MissingValues="Interpolate" ColorField="Yellow">
<TooltipsAppearance Color="White" DataFormatString="{1} Low Vulnerabilities"></TooltipsAppearance>
<LabelsAppearance Visible="false">
</LabelsAppearance>
</telerik:ScatterLineSeries>
<telerik:ScatterLineSeries Name="Information Level" DataFieldX="Date" DataFieldY="info" MissingValues="Interpolate" ColorField="Green">
<TooltipsAppearance Color="White" DataFormatString="{1} Information Level Findings"></TooltipsAppearance>
<LabelsAppearance Visible="false">
</LabelsAppearance>
</telerik:ScatterLineSeries>
</Series>
<XAxis BaseUnit="Days" AxisCrossingValue="0" Color="#b3b3b3" MajorTickType="Outside" MinorTickType="Outside" DataLabelsField="d" Type="Date">
<LabelsAppearance RotationAngle="0" DataFormatString="M/d/yyyy"></LabelsAppearance>
<MajorGridLines Color="#EFEFEF"></MajorGridLines>
<MinorGridLines Color="#F7F7F7"></MinorGridLines>
<TitleAppearance Position="Center" Text="Date"></TitleAppearance>
</XAxis>
<YAxis Color="#b3b3b3" MajorTickSize="1" MajorTickType="Outside" MinValue="0" MinorTickSize="1" MinorTickType="Outside">
<LabelsAppearance DataFormatString="{0}" RotationAngle="0"></LabelsAppearance>
<MajorGridLines Color="#EFEFEF" Width="1"></MajorGridLines>
<MinorGridLines Color="#F7F7F7" Width="1"></MinorGridLines>
<TitleAppearance Position="Center" Text="Number of Items"></TitleAppearance>
</YAxis>
</PlotArea>
<ChartTitle Text=""></ChartTitle>
<Legend>
<Appearance Position="Bottom"></Appearance>
</Legend>
</telerik:RadHtmlChart>
这是颜色错误的图表截图:
如有任何想法,我们将不胜感激。我到处搜索以寻找解决方案,我再次重写了之前的代码,以便直接在 .aspx 页面上设置色域,但它仍然什么也没做。
您必须设置[系列类型]。Appearance.FillStyle.BackgroundColor 才能更改线条的颜色,并且根本不使用 ColorField!