How to get Highchart Gauge to work in Sencha Touch 2

Trying to use Highcharts with Sencha Touch 2.3.1

I use this from JoKuan

Tall charts do not seem to display, but the containers are assigned the identifier Highcharts (ext-highcharts) and the class that is in my code:

Graphs created using this:

theGauge = new Ext.create('Chart.ux.Highcharts', {   
  xtype: 'highchart',
  cls: 'ag',//component renders with this class ok
  series:[{
    dataIndex: 'CurrentValue'
  }],
  store: gaugeStore,
  chartConfig: {
    chart: {
      type: 'gauge'
    },
    title: {
      text: 'A simple graph'
    }
  }
});

console.log(theGauge);

This is the container for the chart:

chartgx = Ext.Container({
  xtype : 'container',
  flex: 1,
  layout: 'fit',
  items: [], 
  id: 'innerGauge_'+tt+'_'+tt2,
  itemId: 'x-innerGauge_'+tt+'_'+tt2
});

Ext.getCmp('gauge_'+tt+'_'+tt2).add(chartgx); //add inner container to outer container
Ext.getCmp('innerGauge_'+tt+'_'+tt2).add(theGauge); //add gauge to inner container

My App.js has:
requires: [ 'Chart.ux.Highcharts', 'Chart.ux.Highcharts.Serie', 'Chart.ux.Highcharts.AreaRangeSerie', 'Chart.ux.Highcharts.AreaSerie', 'Chart.ux.Highcharts.AreaSplineRangeSerie', 'Chart.ux.Highcharts.AreaSplineSerie', 'Chart.ux.Highcharts.BarSerie', 'Chart.ux.Highcharts.ColumnRangeSerie', 'Chart.ux.Highcharts.ColumnSerie', 'Chart.ux.Highcharts.GaugeSerie', 'Chart.ux.Highcharts.LineSerie', 'Chart.ux.Highcharts.PieSerie', 'Chart.ux.Highcharts.RangeSerie', 'Chart.ux.Highcharts.ScatterSerie', 'Chart.ux.Highcharts.SplineSerie', 'Chart.ux.ChartsMobileConfig', .....]

The object called theGaugeis present in my source code, but the graphic diagram is not displayed.

The store looks fine, console.log shows raw data to enable:
raw: Object BaseValue: 0 CentreValue: 756.79 CurrentValue: 413.55 Generated: "/Date(1399375165754+0100)/" Title: "Order Value Today" Type: 1

I looked through this post and made the changes recommended, but still not successful.

+4
1

Sencha Touch, Sencha Ext JS.

, Sencha ExtJS Highcharts. Highchart/HighStock html div, . html div Ext Js, . , :

var myVp = Ext.create('Ext.container.Viewport', {.........}

chart1 = new Highcharts.StockChart({
   chart: {
      renderTo: myVp.down('#Graph1').getEl().dom,
      zoomType: 'x'
   },
............
............
});

Graph1, - myVp

  {
    flex: 8,
    xtype : "component", //i have other examples where the xtype is panel that
                         //work fine. I think this will work with all the type
                         //on containers
    itemId: 'Graph1'
  }

, , , , . , sencha . JsFiddle. .

+3

Source: https://habr.com/ru/post/1539431/


All Articles