【问题标题】:Is there a way the to change RadChart legend text color?有没有办法改变 RadChart 图例文本颜色?
【发布时间】:2019-11-12 16:47:31
【问题描述】:

我正在尝试使用深色主题为我的应用设置样式,而图例项为黑色。有没有办法改变图例项目的颜色?有一个属性可以更改标题颜色,但不会影响其他系列名称。

example picture

<RadPieChart allowAnimation="true" height=100% row="1" col="0" colSpan="12">
               <DonutSeries tkPieSeries
                   selectionMode="DataPoint"
                   expandRadius="0.4"
                   outerRadiusFactor="0.7"
                   innerRadiusFactor="0.4"
                   valueProperty="Amount"
                   legendLabel="Country"
                   [items]="Countries" class="white"></DonutSeries>
               <Palette tkPiePalette >
                       <PaletteEntry tkPiePaletteEntry fillColor="#EB5E55" strokeColor="#EB5E55"></PaletteEntry>
                       <PaletteEntry tkPiePaletteEntry fillColor="#D81E5B" strokeColor="#D81E5B"></PaletteEntry>
                       <PaletteEntry tkPiePaletteEntry fillColor="#FDF0D5" strokeColor="#FDF0D5"></PaletteEntry>
                       <PaletteEntry tkPiePaletteEntry fillColor="#C6D8D3" strokeColor="#C6D8D3"></PaletteEntry>
                       <PaletteEntry tkPiePaletteEntry fillColor="#00FDDC" strokeColor="#00FDDC"></PaletteEntry>
                       <PaletteEntry tkPiePaletteEntry fillColor="#495F41" strokeColor="#495F41"></PaletteEntry>
                   </Palette>
             <Palette tkPiePalette seriesState="Selected">
                   <PaletteEntry tkPiePaletteEntry fillColor="#EB5E55" strokeColor="#EB5E55"></PaletteEntry>
                   <PaletteEntry tkPiePaletteEntry fillColor="#D81E5B" strokeColor="#D81E5B"></PaletteEntry>
                   <PaletteEntry tkPiePaletteEntry fillColor="#FDF0D5" strokeColor="#FDF0D5"></PaletteEntry>
                   <PaletteEntry tkPiePaletteEntry fillColor="#C6D8D3" strokeColor="#C6D8D3"></PaletteEntry>
                   <PaletteEntry tkPiePaletteEntry fillColor="#00FDDC" strokeColor="#00FDDC"></PaletteEntry>
                   <PaletteEntry tkPiePaletteEntry fillColor="#495F41" strokeColor="#495F41"></PaletteEntry>
            </Palette>
               <RadLegendView tkPieLegend position="Right" title="Country" offsetOrigin="TopRight" width="110" enableSelection="true" titleColor="white"></RadLegendView>
       </RadPieChart>

【问题讨论】:

    标签: telerik nativescript nativescript-telerik-ui


    【解决方案1】:

    我认为它目前不支持,Github 中有一个开放的feature request 你可能想关注。

    作为一种解决方法,您可以关闭默认图例视图并使用标签呈现您自己的图例列表。

    【讨论】:

    • 有没有办法在这样做的同时仍然拥有传奇功能?当用户点击图例上的条目时仍然能够触发所选动画会很好。
    • 有可能,我在插件源中看到com.telerik.widget.primitives.legend.LegendSelectionListener 似乎是相关的,您可能必须实现侦听器,选择/取消选择图例。但同样因为它不是开源的,所以很难调试。在 Github 上提出问题可能会给您一些指导。
    猜你喜欢
    • 1970-01-01
    • 2019-10-30
    • 1970-01-01
    • 1970-01-01
    • 2017-07-05
    • 2020-07-09
    • 2015-10-12
    • 1970-01-01
    • 2019-01-16
    相关资源
    最近更新 更多