Jump to content

 

Photo

Setting CustomAxisLabel for the starting value of Y Axis


  • Please log in to reply
2 replies to this topic

#1 Kiti

Kiti

    Member

  • Members
  • PipPip
  • 21 posts

Posted 07 March 2012 - 10:34 AM

Hi,

My project has a requirement to label the starting value of the Y Axis as "Calculated" and the other values will remain as it is in number.

I have attached a screen shot for your reference. The problem with the graph is that now it is showing both the value "Calculated" and 0 as a starting value for Y Axis.

How to disable AxisLabel for only starting point in the graph?

Here is my code:

<vc:Chart xmlns:vc="clr-namespace:Visifire.Charts;assembly=SLVisifire.Charts" Width="600" Height="400" BorderThickness="0.5" Background="White" BorderBrush="Black"
Padding="3" ScrollingEnabled="False">
<vc:Chart.Legends>
<vc:Legend HorizontalAlignment="Right" VerticalAlignment="Bottom" MaxWidth="120"/>
</vc:Chart.Legends>
<vc:Chart.AxesX>
<vc:Axis ValueFormatString="dd/MMM/yyyy"/>
</vc:Chart.AxesX>
<vc:Chart.AxesY>
<vc:Axis AxisMaximum="10" AxisMinimum="0" >
<vc:Axis.Ticks>
<vc:Ticks Enabled="false">
</vc:Ticks>
</vc:Axis.Ticks>
<vc:Axis.AxisLabels>
<vc:AxisLabels Enabled="True">
</vc:AxisLabels>
</vc:Axis.AxisLabels>
<vc:Axis.CustomAxisLabels>
<vc:CustomAxisLabels>
<vc:CustomAxisLabels.Labels>
<vc:CustomAxisLabel From="0" To="0" Text="Calculated">
</vc:CustomAxisLabel>
</vc:CustomAxisLabels.Labels>
</vc:CustomAxisLabels>
</vc:Axis.CustomAxisLabels>
</vc:Axis>
</vc:Chart.AxesY>
<vc:Chart.TrendLines>
<vc:TrendLine Value="3.5" Orientation="Horizontal" LineStyle="Dashed" LineColor="Brown">
</vc:TrendLine>
</vc:Chart.TrendLines>
<vc:Chart.Series>
<vc:DataSeries RenderAs="Line" ShowInLegend="True" Color="Orange" XValueType="Date" LegendText="Decision Date" LegendMarkerType = "Circle" LegendMarkerColor = "Orange" LabelEnabled="True" LabelText="Germany">
<vc:DataSeries.DataPoints>
<vc:DataPoint XValue="03-Aug-2011" AxisXLabel="03-Aug-2011" YValue="3" MarkerColor="Orange" MarkerType="Circle" MarkerSize="10" LabelEnabled="True" MarkerBorderColor="Orange"/>
<vc:DataPoint XValue="01-May-2011" AxisXLabel="01-May-2011" YValue="3" MarkerColor="Orange" MarkerType="Circle" MarkerSize="10" LabelEnabled="False" MarkerBorderColor="Orange"/>
<vc:DataPoint XValue="25-Jan-2012" AxisXLabel="25-Jan-2012" YValue="3" MarkerColor="Orange" MarkerType="Circle" MarkerSize="10" LabelEnabled="False" MarkerBorderColor="Orange"/>
</vc:DataSeries.DataPoints>
</vc:DataSeries>
<vc:DataSeries RenderAs="Line" ShowInLegend="True" Color="Green" XValueType="Date" LegendText="Publication Date" LegendMarkerType = "Triangle" LegendMarkerColor = "Green" LabelEnabled="False" LabelText="">
<vc:DataSeries.DataPoints>
<vc:DataPoint XValue="01-Nov-2011" AxisXLabel="01-Nov-2011" YValue="3" MarkerColor="Green" MarkerType="Triangle" MarkerSize="10" MarkerBorderColor="Green" />
<vc:DataPoint XValue="30-Jul-2011" AxisXLabel="30-Jul-2011" YValue="3" MarkerColor="Green" MarkerType="Triangle" MarkerSize="10" MarkerBorderColor="Green" />
<vc:DataPoint XValue="24-Apr-2012" AxisXLabel="24-Apr-2012" YValue="3" MarkerColor="Green" MarkerType="Triangle" MarkerSize="10" MarkerBorderColor="Green" />
</vc:DataSeries.DataPoints>
</vc:DataSeries>
<vc:DataSeries RenderAs="Line" ShowInLegend="True" Color="Brown" XValueType="Date" LegendText="Launch Date" LegendMarkerType = "Square" LegendMarkerColor = "Brown" LabelEnabled="False" LabelText="">
<vc:DataSeries.DataPoints>
<vc:DataPoint XValue="01-Dec-2011" AxisXLabel="01-Dec-2011" YValue="3" MarkerColor="Brown" MarkerType="Square" MarkerSize="10" MarkerBorderColor="Brown" />
<vc:DataPoint XValue="29-Aug-2011" AxisXLabel="29-Aug-2011" YValue="3" MarkerColor="Brown" MarkerType="Square" MarkerSize="10" MarkerBorderColor="Brown" />
<vc:DataPoint XValue="24-May-2012" AxisXLabel="24-May-2012" YValue="3" MarkerColor="Brown" MarkerType="Square" MarkerSize="10" MarkerBorderColor="Brown" />
</vc:DataSeries.DataPoints>
</vc:DataSeries>
<vc:DataSeries RenderAs="Line" ShowInLegend="False" Color="Orange" XValueType="Date" LegendText="Decision Date" LegendMarkerType = "Circle" LegendMarkerColor = "Orange" LabelEnabled="True" LabelText="Austria">
<vc:DataSeries.DataPoints>
<vc:DataPoint XValue="03-Oct-2011" AxisXLabel="03-Oct-2011" YValue="5" MarkerColor="Orange" MarkerType="Circle" MarkerSize="10" LabelEnabled="True" MarkerBorderColor="Orange"/>
<vc:DataPoint XValue="01-Jul-2011" AxisXLabel="01-Jul-2011" YValue="5" MarkerColor="Orange" MarkerType="Circle" MarkerSize="10" LabelEnabled="False" MarkerBorderColor="Orange"/>
<vc:DataPoint XValue="25-Mar-2012" AxisXLabel="25-Mar-2012" YValue="5" MarkerColor="Orange" MarkerType="Circle" MarkerSize="10" LabelEnabled="False" MarkerBorderColor="Orange"/>
</vc:DataSeries.DataPoints>
</vc:DataSeries>
<vc:DataSeries RenderAs="Line" ShowInLegend="False" Color="Green" XValueType="Date" LegendText="Publication Date" LegendMarkerType = "Triangle" LegendMarkerColor = "Green" LabelEnabled="False" LabelText="">
<vc:DataSeries.DataPoints>
<vc:DataPoint XValue="01-Jan-2012" AxisXLabel="01-Jan-2012" YValue="5" MarkerColor="Green" MarkerType="Triangle" MarkerSize="10" MarkerBorderColor="Green" />
<vc:DataPoint XValue="29-Sep-2011" AxisXLabel="29-Sep-2011" YValue="5" MarkerColor="Green" MarkerType="Triangle" MarkerSize="10" MarkerBorderColor="Green" />
<vc:DataPoint XValue="23-Jun-2012" AxisXLabel="23-Jun-2012" YValue="5" MarkerColor="Green" MarkerType="Triangle" MarkerSize="10" MarkerBorderColor="Green" />
</vc:DataSeries.DataPoints>
</vc:DataSeries>
<vc:DataSeries RenderAs="Line" ShowInLegend="False" Color="Brown" XValueType="Date" LegendText="Launch Date" LegendMarkerType = "Square" LegendMarkerColor = "Brown" LabelEnabled="False" LabelText="">
<vc:DataSeries.DataPoints><vc:DataPoint XValue="02-Dec-2011" AxisXLabel="02-Dec-2011" YValue="5" MarkerColor="Brown" MarkerType="Square" MarkerSize="10" MarkerBorderColor="Brown" />
<vc:DataPoint XValue="30-Aug-2011" AxisXLabel="30-Aug-2011" YValue="5" MarkerColor="Brown" MarkerType="Square" MarkerSize="10" MarkerBorderColor="Brown" />
<vc:DataPoint XValue="24-May-2012" AxisXLabel="24-May-2012" YValue="5" MarkerColor="Brown" MarkerType="Square" MarkerSize="10" MarkerBorderColor="Brown" />
</vc:DataSeries.DataPoints>
</vc:DataSeries>
</vc:Chart.Series>
</vc:Chart>

Please suggest asap.

Attached Files

  • Attached File  Calc.png   22.29K   11 downloads


#2 shoaib

shoaib

    Advanced Member

  • Members
  • PipPipPip
  • 924 posts
  • Gender:Male
  • Location:Bangalore

Posted 07 March 2012 - 12:36 PM

Hi Kiti,

Try setting ValueFormatString="#" in AxisY and check.

Regards,
Shoaib

#3 Kiti

Kiti

    Member

  • Members
  • PipPip
  • 21 posts

Posted 07 March 2012 - 01:15 PM

I tried with setting

ValueFormatString=\"##;(#0#);\0\

and it resolved my issue.

Thanks.

Kiti




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users