【问题标题】:How to change Mvc Pie Chart colors?如何更改 Mvc 饼图颜色?
【发布时间】:2014-08-24 05:08:52
【问题描述】:

我有一个饼图类型,需要更改 Mvc 图表中用作默认设置的颜色!

这是我的图表系列

<Series _Template_=""All"" 
ShadowOffset=""2"" 
BorderColor=""64, 64, 64"" 
BorderDashStyle=""Solid"" 
BorderWidth=""1"" 
Color=""189, 215, 191""
IsValueShownAsLabel=""false"" 
Font=""Hacen Typographer, 12pt, GdiCharSet=0"" 
LabelForeColor=""100, 100, 100"" 
CustomProperties=""DoughnutRadius=60, 
PieLabelStyle=Outside, 
PieDrawingStyle=SoftEdge"" 
ChartType=""pie"" />

作为字符串,那么我在哪里可以为每个饼图点或部分设置颜色!

【问题讨论】:

    标签: asp.net-mvc asp.net-mvc-3 charts pie-chart


    【解决方案1】:

    找到了……

    我用这个是他们的谎言

    "

    <ChartArea Name=""Default"" _Template_=""All"" 
    
        BackColor=""Transparent"" BackSecondaryColor=""White"" BorderDashStyle=""Solid"" ShadowColor=""Transparent"">
    
      <AxisY>
    
        <LabelStyle Font=""Trebuchet MS, 8.25pt, style=Bold"" />
    
      </AxisY>
    
      <AxisX LineColor=""64, 64, 64, 64"">
    
        <LabelStyle Font=""Trebuchet MS, 8.25pt, style=Bold"" />
    
      </AxisX>
    
    </ChartArea>
    

    <Legend _Template_=""All"" BackColor=""Transparent"" Docking=""Bottom"" Font=""Trebuchet MS, 8.25pt, style=Bold""
    

    LegendStyle=""行"">

    </Legend>
    

    "

    给馅饼上色的关键是在这里改变

    PaletteCustomColors=""180, 189,175;134,192, 106;189, 215, 121""
    

    根据需要添加均匀颜色 RGB :)

    【讨论】:

    • 在哪里添加 PaletteCustomColors ?
    【解决方案2】:

    Palette 应该设置为 None 才能正常工作

    <Chart PaletteCustomColors=""180, 189,175;134,192, 106;189, 215, 121"" Palette=""None"">
    

    【讨论】:

      猜你喜欢
      • 2012-10-12
      • 1970-01-01
      • 1970-01-01
      • 2012-04-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-08-23
      相关资源
      最近更新 更多