Jump to content

 

Photo
- - - - -

Y Axis Label


  • Please log in to reply
6 replies to this topic

#1 Jason Barr

Jason Barr

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 27 May 2010 - 06:00 PM

I am currently working on setting the Y Axis label on various charts and i was wondering if the visifire charts have this capability. I noticed that the Y Value for a given data point is a double so there is not way to set this Value as text. I have also noticed the vfChart.AxisY.AxisLabels has not ability to set text for these labels. Am i missing something?? I have attached a sample from an existing application where we did not use visifire and was wanting to get the same functionality.

Thanks
Jason Barr

#2 shoaib

shoaib

    Advanced Member

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

Posted 28 May 2010 - 05:18 AM

Hi Jason,

You cannot set text(string) inside AxisYLabels as Visifire doesn't support this feature. Also, we did not find the sample attached along with your post. Would you please attach the sample so that we can look into the matter again.

#3 Jason Barr

Jason Barr

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 28 May 2010 - 01:26 PM

Hi Jason,

You cannot set text(string) inside AxisYLabels as Visifire doesn't support this feature. Also, we did not find the sample attached along with your post. Would you please attach the sample so that we can look into the matter again.


Here is the attachment please let me know if you know any work around or when this feature will be available.

Attached File  sample.png   16.05K   38 downloads

Thanks
Jason

#4 vivek

vivek

    Advanced Member

  • Team Visifire
  • PipPipPip
  • 3,605 posts
  • Gender:Male
  • Location:Bangalore

Posted 31 May 2010 - 05:09 AM

Hi Jason,

Currently there is no workaround to achieve this as Visifire supports only double values in AxisY. It is present in our wishlist.

Regards,
Vivek
Team Visifire


#5 somnath

somnath

    Advanced Member

  • Team Visifire
  • PipPipPip
  • 983 posts
  • Gender:Male
  • Location:Bangalore

Posted 04 June 2010 - 09:05 PM

Hi Jason,

CustomAxisLabels for axis has been implemented in Visifire. Please checkout the blog post here. Below is an example for you.

Posted Image

Chart XAML
<vc:Chart  xmlns:vc="clr-namespace:Visifire.Charts;assembly=SLVisifire.Charts"
Width="500" Height="300" Theme="Theme1" BorderThickness="0.5" BorderBrush="Gray" AnimatedUpdate="true" >

            <vc:Chart.Titles>
                <vc:Title Text="Athens 2004 Olympics" FontFamily="Arial" FontSize="14"/>
            </vc:Chart.Titles>
      
            <vc:Chart.AxesX>
                <vc:Axis Title="Country"/>
            </vc:Chart.AxesX>

            <vc:Chart.AxesY>
                <vc:Axis AxisMinimum="0" AxisMaximum="60" Title="Gold Medals Won">
                    <vc:Axis.Ticks>
                        <vc:Ticks Enabled="false"></vc:Ticks>
                    </vc:Axis.Ticks>
                    <vc:Axis.AxisLabels>
                        <vc:AxisLabels Enabled="false"></vc:AxisLabels>
                    </vc:Axis.AxisLabels>
                    <vc:Axis.CustomAxisLabels>
                        <vc:CustomAxisLabels>
                            <vc:CustomAxisLabels.Labels>
                                <vc:CustomAxisLabel From="0" To="0" Text="Zero"></vc:CustomAxisLabel>
                                <vc:CustomAxisLabel From="10" To="10" Text="Ten"></vc:CustomAxisLabel>
                                <vc:CustomAxisLabel From="20" To="20" Text="Twenty"></vc:CustomAxisLabel>
                                <vc:CustomAxisLabel From="30" To="30" Text="Thirty"></vc:CustomAxisLabel>
                                <vc:CustomAxisLabel From="40" To="40" Text="Fourty"></vc:CustomAxisLabel>
                                <vc:CustomAxisLabel From="50" To="50" Text="Fifty"></vc:CustomAxisLabel>
                                <vc:CustomAxisLabel From="60" To="60" Text="Sixty"></vc:CustomAxisLabel>
                            </vc:CustomAxisLabels.Labels>
                        </vc:CustomAxisLabels>
                    </vc:Axis.CustomAxisLabels>                    
                </vc:Axis>
            </vc:Chart.AxesY>

            <vc:Chart.Series>
                <vc:DataSeries RenderAs="Column" LabelEnabled="True">
                    <vc:DataSeries.DataPoints>
                        <vc:DataPoint AxisXLabel="USA" YValue="50"/>
                        <vc:DataPoint AxisXLabel="China" YValue="35"/>
                        <vc:DataPoint AxisXLabel="Russia" YValue="27"/>
                        <vc:DataPoint AxisXLabel="Australia" YValue="17"/>
                        <vc:DataPoint AxisXLabel="Japan" YValue="16"/>
                    </vc:DataSeries.DataPoints>
                </vc:DataSeries>
            </vc:Chart.Series>
        </vc:Chart>
Regards,
Somnath

#6 flyhere

flyhere

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 03 February 2011 - 05:40 AM

dear sir:

I am doing something similor to the abover sample but implemented in C# code.

VisifireChart Chart_Result = new VisifireChart();
List<string> YaxisLableS = new List<string>();
...
Visifire.Charts.Axis Yaxis = new Visifire.Charts.Axis();
CustomAxisLabelsCollection calc = new CustomAxisLabelsCollection();
CustomAxisLabels cals = new CustomAxisLabels();
for (int i = 0; i < YaxisLableS.Count; i++)
{
CustomAxisLabel cal = new CustomAxisLabel();
cal.From = cal.To = i;
cal.Text = YaxisLableS[i];
cals.Labels.Add(cal);
}
calc.Add(cals);
Yaxis.CustomAxisLabels = calc; cals;

Chart_Result.AxesY.Add(Yaxis);

It does not work.
Would you please give me some hits?
thank you !


I have known and corrected it.

#7 TripsSAR

TripsSAR

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 21 February 2012 - 09:33 PM

CustomAxisLabels cals = new CustomAxisLabels();
for (int i = 0; i < YaxisLableS.Count; i++)
{
CustomAxisLabel cal = new CustomAxisLabel();
cal.From = cal.To = i;
cal.Text = YaxisLableS[i];
cals.Labels.Add(cal);
}
calc.Add(cals);
Yaxis.CustomAxisLabels = calc; cals;

Chart_Result.AxesY.Add(Yaxis);

[s]It does not work.

I have known and corrected it.


In case anyone else stumbles across this... the fix is to .Add the new cal to the existing Yaxis.CustomAxisLabels (maybe .Clear it first), not to assign a brand-new CustomAxisLabels instance to Yaxis.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users