1. #1
    Sencha User
    Join Date
    Jul 2012
    Location
    USA
    Posts
    3
    Vote Rating
    0
    ibar98 is on a distinguished road

      0  

    Default Unanswered: Dynamically change chart axis date format

    Unanswered: Dynamically change chart axis date format


    If the range of a chart's time axis falls within a certain range, I would like to change how the date is formatted. E.g., if the range falls within one day I would like the axis to display hours/minutes instead of the normal month/day. Conceptually, something like this:

    Code:
    chart.axes.items[1].dateFormat = 'H:i';
    However, I've been unable to get the axis to update to a new dateFormat thus far. Does anyone have any suggestions as to how I can accomplish this?

    Thanks!

  2. #2
    Sencha User
    Join Date
    Jul 2012
    Location
    USA
    Posts
    3
    Vote Rating
    0
    ibar98 is on a distinguished road

      0  

    Default


    Any ideas?

  3. #3
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,916
    Answers
    655
    Vote Rating
    443
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    Can you use the renderer to format the label?

    Code:
    label: {
        renderer: function(date) {
         // format date
        }
    }
    Scott.

  4. #4
    Sencha User
    Join Date
    Jul 2012
    Location
    USA
    Posts
    3
    Vote Rating
    0
    ibar98 is on a distinguished road

      0  

    Default


    Hi Scott, thank you for replying.

    While this would theoretically work, it would also then require me to manually set the step for the axis. When trying to dynamically set the step for the currently selected date range, I've often found the graph to not render correctly (series going right off of the graph). I've chalked this up to the step not liking to be altered after initial instantiation as well. Please correct me if I'm wrong.

  5. #5
    Sencha User
    Join Date
    Jul 2012
    Location
    bangalore
    Posts
    16
    Vote Rating
    0
    loki4u is on a distinguished road

      0  

    Default


    chart.axes.items[1].dateFormat = 'H:i';

    chart.series.items[1].drawSeries();chart.axes.items[1].drawAxis();

    probably it would help..

    or


    we can format data in model itself as follows:

    Ext.define('model.Chart', {
    extend: 'Ext.data.Model'
    ,fields : [
    {name:'date',type:'date',convert:function(date){
    var dt = Ext.Date.parse(date, "Y m");
    return Ext.Date.format(dt, 'F ,Y');
    }
    } ]
    }

Thread Participants: 2

Tags for this Thread

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