首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为RadChart定制图例

为RadChart定制图例
EN

Stack Overflow用户
提问于 2015-01-20 05:02:04
回答 1查看 1.2K关注 0票数 0

如何自定义图例中的文本。我正在使用telerik工具。如何从后端更改图例文本?c#或vb.net代码就足够了。根据客户需求,我需要显示来自x轴和y轴的组合文本,并在图例中显示。下面是用于此的代码。

代码语言:javascript
复制
                <telerik:radchart id="radchart_teamchart" autolayout="true" charttitle-appearance-fillstyle-fillsettings-imagealign="Center"
                    chartimageformat="Png" charttitle-visible="true" seriesorientation="Vertical"
                    width="900px" defaulttype="Bubble" runat="server" skin="Vista" autotextwrap="true"
                    intelligentlabelsenabled="true">
                    <ChartTitle TextBlock-Text="My  New Customer Status">
                    </ChartTitle>
                    <Series>
                        <telerik:ChartSeries DataYColumn="noofcustomer" Name="Order" Type="Bar" Appearance-BarWidthPercent="10">
                            <Appearance LabelAppearance-Visible="false">
                                <TextAppearance TextProperties-Font="Cambria, 8.25pt" Position-AlignedPosition="TopLeft">
                                </TextAppearance>

                                <FillStyle MainColor="DarkOrange" SecondColor="WhiteSmoke" FillType="Gradient">
                                </FillStyle>
                                <PointMark Visible="True" Border-Width="2" Border-Color="DarkKhaki" Dimensions-AutoSize="false"
                                    Dimensions-Height="10px" Dimensions-Width="6px">
                                    <FillStyle MainColor="Red" FillType="solid">
                                    </FillStyle>
                                </PointMark>
                                <LineSeriesAppearance Width="6"></LineSeriesAppearance>
                            </Appearance>
                        </telerik:ChartSeries>
                    </Series>
                    <PlotArea>
                        <XAxis DataLabelsColumn="month" AxisLabel-Visible="true" AxisLabel-TextBlock-Text="Month"
                            AxisLabel-TextBlock-Appearance-TextProperties-Color="Brown">
                            <Appearance>
                                <TextAppearance TextProperties-Font="Arial, 8.25pt, style=Bold" Dimensions-Paddings="0.5px">
                                </TextAppearance>
                                <LabelAppearance RotationAngle="270">
                                </LabelAppearance>
                            </Appearance>
                        </XAxis>
                        <YAxis AxisMode="Normal" MaxItemsCount="7" AxisLabel-Visible="true" AxisLabel-TextBlock-Text="No Of Cusotmers"
                            AxisLabel-TextBlock-Appearance-TextProperties-Color="Brown">
                            <Appearance>
                                <TextAppearance TextProperties-Font="Arial, 8.5pt, style=Bold">
                                </TextAppearance>
                            </Appearance>
                        </YAxis>
                    </PlotArea>
                    <Legend Visible="true" ></Legend>
                </telerik:radchart>  
EN

回答 1

Stack Overflow用户

发布于 2015-01-20 14:02:25

我不认为这是一个传奇,因此,我认为你不能这样做。

我建议您首先查看控件文档,并探索可用的属性,以确定某些内容是否对您有用:

  • http://www.telerik.com/help/aspnet-ajax/chart-styling-custom-appearance-properties.html
  • http://www.telerik.com/help/aspnet-ajax/chart-styling-elements.html
  • http://www.telerik.com/help/aspnet-ajax/chart-legenddisplaymode.html -请注意ItemLabels选项,它将项放置在图例中。
  • http://www.telerik.com/help/aspnet-ajax/chart-legend.html -还有一些关于建立自定义传说的选项,所以这可以帮助

另一个想法是从数据源构建自定义图例。您可以在这里看到一个示例方法( http://demos.telerik.com/aspnet-ajax/htmlchart/examples/functionality/custombarcolor/defaultcs.aspx ),尽管图表是当前的RadHtmlChart控件(对于这个较新的图表控件来说,RadChart是不推荐的)。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/28038084

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档