1. #1
    Ext User
    Join Date
    Aug 2009
    Posts
    27
    Vote Rating
    0
    madhu_g is on a distinguished road

      0  

    Default How can i add a label for x-axis and y-axis for a chart?

    How can i add a label for x-axis and y-axis for a chart?


    Suppose i am giving my X axis labels as jan,feb,mar,apr,may. At the bottom of these labels i want to display a label as "Months". Same thing i need for Y axis also. can any body help me out in getting this ?

  2. #2
    Ext User
    Join Date
    Aug 2009
    Posts
    27
    Vote Rating
    0
    madhu_g is on a distinguished road

      0  

    Default


    I have used chartmodel.setXLegend( new Text("Months") );

    Now it doesn't even displaying the chart. I guess i am missing out some thing. what is the missing thing here ? or is it a bug ?

  3. #3
    Sencha Premium Member
    Join Date
    Feb 2009
    Location
    Glasgow, Scotland
    Posts
    309
    Vote Rating
    9
    Stuart-SwarmOnline will become famous soon enough

      0  

    Default


    Try adding..

    Code:
    ...
                            xAxis: new Ext.chart.Axis({
                                title: 'XXXXX'
                            }),
                            yAxis: new Ext.chart.Axis({
                                title: 'XXXXX'
                            }),
    ...
    to the chart config

  4. #4
    Ext User
    Join Date
    Aug 2009
    Posts
    27
    Vote Rating
    0
    madhu_g is on a distinguished road

      0  

    Default


    I am using EXT GWT . how can i do the same thing in this ?

  5. #5
    Ext GWT Premium Member
    Join Date
    Jul 2009
    Posts
    131
    Vote Rating
    1
    arkadye is on a distinguished road

      0  

    Default


    I had a similar problem and figured out that axis labels work if you pass the style parameter to the Text constructor, for example:

    chartmodel.setXLegend(new Text("Months", "font-size: 12px; font-family: Verdana; text-align: center;"));

  6. #6
    Sencha User borisperezg's Avatar
    Join Date
    May 2010
    Posts
    22
    Vote Rating
    0
    borisperezg is on a distinguished road

      0  

    Default


    Wooaa.... thats correct, thx a lot for the tip....

  7. #7
    Sencha User
    Join Date
    Mar 2011
    Posts
    19
    Vote Rating
    0
    dhruv88esh is on a distinguished road

      0  

    Default Problem in showing Tooltips

    Problem in showing Tooltips


    Hi friends,
    I have set the labels as jan, feb,.... using
    XAxis xAxis = new XAxis();
    xAxis.setLabels("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
    chartModel.setXAxis(xAxis);

    Now i want to show them at the Dot in the tooltips, so i'm doing this:-

    lineChart.getDotStyle().setTooltip("[Messages: #x_label#, #val#]");

    Its showing like this :-
    [Messages: , 20]

    But its not showing the labels in the tooltips..
    How can i show these labels in the tooltips..???

  8. #8
    Sencha User
    Join Date
    Jul 2014
    Posts
    1
    Vote Rating
    0
    pranay_j is on a distinguished road

      0  

    Default The same thing is not woking for me

    The same thing is not woking for me


    Quote Originally Posted by borisperezg View Post
    Wooaa.... thats correct, thx a lot for the tip....
    Which suggestion did work for you ?

    chartmodel.setXLegend(new Text("Months", "font-size: 12px; font-family: Verdana; text-align: center;"));

    Its not reflecting anything on my GUI.