如何标记在ASP.Net图表控件的周线图 [英] How to label the weekly chart in ASP.Net chart control

查看:426
本文介绍了如何标记在ASP.Net图表控件的周线图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下的统计图显示,每周步行用户。目前,它显示的日期。是否有显示weekwise数据的任何专业的方式。

以下code用于生成图表

 < ASP:图表ID =Chart2=服务器HEIGHT =450调色板=火的CssClass =COL-MD-12>
                <&系列GT;
                    < ASP:系列名称=系列1XValueMember =xdateYValueMembers =TimePerD​​ayChartArea =ChartArea2图表类型=列YValues​​PerPoint =6IsValueShownAsLabel =真LabelFormat ={0:N0}IsXValueIndexed =真>
                    < / ASP:系列>
                < /系列>
                < ChartAreas>
                    < ASP:ChartArea NAME =ChartArea2>
                        < AxisY间隔=60>
                            < MajorGrid启用=真LineColor =浅灰色/>
                            <带状线>
                                &所述; asp的:带状线TextAlignment =近BorderDashStyle =固体BORDERCOLOR =#0000FF边框宽度=2背景色=#0000FF/>
                                < ASP:带状线边框宽度=10/>
                            < /条线>
                        < / AxisY>
                        < AxisX IsLabelAutoFit =假TitleForeColor =黑间隔=1>
                            < LabelStyle格式=DD-MM-YY角度= - 90IsEndLabelVisible =真/>
                            < MajorGrid启用=FALSE/>
                        < / AxisX>
                    < / ASP:ChartArea>
                < / ChartAreas>
                                < / ASP:图表>


解决方案

努力推动一周数据成图时,我一直用weeknumbering在Excel中,但是你的X轴将有效地需要一个字符串像'YYYY-WW 还是2015-32这样它将进行排序,并为了为了正确地在图表中。

获取给定日期的正确的周数

I have the following chart which shows user walking per week. At the moment it shows the dates. Is there any professional way to show weekwise data.

The following code is used to generate the chart

 <asp:Chart ID="Chart2" runat="server" Height="450" Palette="Fire" CssClass="col-md-12">
                <Series>
                    <asp:Series Name="Series1" XValueMember="xdate" YValueMembers="TimePerDay" ChartArea="ChartArea2" ChartType="column" YValuesPerPoint="6" IsValueShownAsLabel="true" LabelFormat="{0:N0}" IsXValueIndexed="true">
                    </asp:Series>
                </Series>
                <ChartAreas>
                    <asp:ChartArea Name="ChartArea2">
                        <AxisY Interval="60">
                            <MajorGrid Enabled="true" LineColor="lightgray" />
                            <StripLines>
                                <asp:StripLine TextAlignment="Near" BorderDashStyle="Solid" BorderColor="#0000ff" BorderWidth="2" BackColor="#0000ff" />
                                <asp:StripLine BorderWidth="5" />
                            </StripLines>
                        </AxisY>
                        <AxisX IsLabelAutoFit="false" TitleForeColor="black" Interval="1">
                            <LabelStyle Format="dd-MM-yy" Angle="-90" IsEndLabelVisible="true" />
                            <MajorGrid Enabled="false" />
                        </AxisX>
                    </asp:ChartArea>
                </ChartAreas>
                                </asp:Chart>

解决方案

I have always used weeknumbering in excel when trying to push week data into graphs, however your x axis will effectively need to be a string something like 'yyyy-ww' or 2015-32 such that it will sort and order order correctly in the chart.

Get the correct week number of a given date

这篇关于如何标记在ASP.Net图表控件的周线图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆