2

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. enter image description here

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>
Dr. Mian
  • 3,334
  • 10
  • 45
  • 69

1 Answers1

1

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

Community
  • 1
  • 1
MulderX
  • 23
  • 4