2017-07-26 4 views
0

enter image description here Sagen Sie mir bitte, wie Redner Datum auf Diagramm? Auf X-Achse ID gerne Datum im Format "m-d" anzeigen.ExtJS 6 Wie redner Datum auf Diagramm

Sag mir bitte heiß, es zu machen. Leider zeigt mein Diagramm Datum wie "Y-m-d h-i-s" im Anhang.

axes: [{ 
         type: 'numeric', 
         position: 'left', 
         grid: true 
        }, 
        { 
         type: 'time', 
         position: 'bottom', 
         visibleRange: [0, 1], 
        } 

       ], 

       series: [{ 
        type: 'line', 
        highlight: true, 
        xField: 'date', 
        yField: ['count'], 
        title: ['Настройка из ЛК штук'], 
         // Отображение подсказки при наводке на график 
        tooltip: { 
         trackMouse: true, 
         renderer: function(tip, item) { 
          // Определяем день и месяц для их корректного отображения в tip 
          var date = new Date(item.get('date')); 
          var day = date.getDate(); 
          // Прибавляем к месяцу 1 , т.к getMonth почемуто возвращает на месяц меньше 
          var month = date.getMonth() + 1; 
          tip.setTitle('Количество: ' + item.get('count') + ' шт.'); 
          tip.update('Дата: ' + day + "." + month); 
         } 
        } 
       }] 

Antwort

0

sollten Sie legen die dateFormat Achse config "Y-m-d h-i-s".

+0

Thx. i fügen Sie diese und es ist ok 'Achsen: [{ Typ: 'numerisch', Position: 'links', Raster: true }, { Typ: 'Zeit', Datumsformat: 'D. M', Position: 'unten', visibleRange: [0, 1], } ] ' – Masquitos