1. #1
    Sencha User
    Join Date
    Jun 2012
    Posts
    7
    Vote Rating
    0
    RaKku is on a distinguished road

      0  

    Default X-axis spacing for plots

    X-axis spacing for plots


    Hi,
    So I noticed that the charts are rendered evenly for the X-axis. However, is there a way for this not to happen? For instance, if there are 3 x-axis values (ex. 5, 10, 100), the chart will render the points evenly spaced 1/3. Is there a way to relatively display the plot so that 5 and 10 is spaced more together and point 100 would be further down to the right? I just want to show the user that there is a huge gap between 10 and 100 compared to 5 and 10 (instead of it being evenly spaced).

    I was trying to hunt down any settings the Chart or CategoryAxis might have, but no such luck.

    Thanks!

    -Ben

  2. #2
    Sencha - GXT Dev Team BrendanC's Avatar
    Join Date
    Aug 2010
    Posts
    534
    Vote Rating
    3
    BrendanC is on a distinguished road

      0  

    Default


    The first thing that comes to mind is that you could set the dash size of the axis to 0 and then using a custom label provider blank all labels except 5, 10 and 100.

  3. #3
    Sencha - GXT Dev Team BrendanC's Avatar
    Join Date
    Aug 2010
    Posts
    534
    Vote Rating
    3
    BrendanC is on a distinguished road

      0  

    Default


    Oh wait just realized you mentioned category axis. If you want to have scaling based on value you should use numeric axis on the x-axis.

  4. #4
    Sencha User
    Join Date
    Jun 2012
    Posts
    7
    Vote Rating
    0
    RaKku is on a distinguished road

      0  

    Default


    Quote Originally Posted by BrendanC View Post
    Oh wait just realized you mentioned category axis. If you want to have scaling based on value you should use numeric axis on the x-axis.
    So I am a little unsure. Right now I have it as:

    CategoryAxis<DataTimeStamp, String> catAxis = new CategoryAxis<DataTimeStamp, String>();

    I should make it to (same as the Y-axis)?:

    NumericAxis<DataTimeStamp> numAxis = new NumericAxis<DataTimeStamp>();

    This will change for setting the field right, since for NumericAxis I am adding a field whereas CategoryAxis I am setting only one dataAccess.name() onto the field? Sorry, just a little confused...

    *Update: Even if I change the X-axis to NumericAxis, I noticed the chart still plots, but I just see "NaN" on the 0 value for the X-axis and nothing else labeled on the right side of the x-axis. I am assuming I am labeling it incorrectly on the X-axis...*

  5. #5
    Sencha - GXT Dev Team BrendanC's Avatar
    Join Date
    Aug 2010
    Posts
    534
    Vote Rating
    3
    BrendanC is on a distinguished road

      0  

    Default


    Yes you would set up x-axis the same way you setup the y-axis. If add the field for the 5, 10 and 100 values it should render correctly. Also you will need to tell the series to use the correct x axis and x field just like with the y.

  6. #6
    Sencha User
    Join Date
    Jun 2012
    Posts
    7
    Vote Rating
    0
    RaKku is on a distinguished road

      0  

    Default


    Quote Originally Posted by BrendanC View Post
    Yes you would set up x-axis the same way you setup the y-axis. If add the field for the 5, 10 and 100 values it should render correctly. Also you will need to tell the series to use the correct x axis and x field just like with the y.
    Hmm, so I must be doing something wrong. For the X-axis I am getting values of the Y-axis.

    Since I am changing the x-axis to be y-axis, I can't use the setField (ex.
    catAxis.setField(dataAccess.name())).



    Instead, I need to use the addField (which would explain why I am getting the y-axis values for the x-axis). I have something like this for the Y-axis and one of the series:


    NumericAxis<DataTimeStamp> yAxis = new NumericAxis<DataTimeStamp>();
    axis.setPosition(Position.Bottom);
    // not sure what to add here...

    yAxis.addField(dataAccess.value1());
    yAxis.addField(dataAccess.value2());
    yAxis.addField(dataAccess.value3());

    LineSeries<DataTimeStamp> series1 = new LineSeries<DataTimeStamp>();
    series1.setYAxisPosition(Position.LEFT);
    series1.setYField(dataAccess.value1());
    series1.setXField(dataAccess.name());
    series1.setXAxisPosition(Position.BOTTOM);


    When the chart is rendered though, it could have patches in the background where it is either gray or white. I attached image of what I see..


    sencha1.jpeg

  7. #7
    Sencha - GXT Dev Team BrendanC's Avatar
    Join Date
    Aug 2010
    Posts
    534
    Vote Rating
    3
    BrendanC is on a distinguished road

      0  

    Default


    That is because the example axis you are using has a custom grid config. If you remove that the gray blocks will go away. Also looking at your image it would appear the lines are going off the chart. Do you still have minimum and maximum set?

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi