Dynamic vs static charts

Hi, is it possible to convert a dynamic chart in static chart and viceversa? I tried changing dynamic property from true to false but the xAxis keeps containing a limited number of items…

Many thanks in advance

Here’s a snippet:

var data = [];
for (var i=0; i<=200; i++)
  data.push({ time: i+1,
             sales: Math.round(Math.random()*5000+2000),
             sales2: Math.round(Math.random()*5000+2000)*0.5
            });
var chart = {
  view:"chart", 
  id:"dchart",
  type:"spline",
  value:"#sales#",
  xAxis:{ template:"#time#" },
  yAxis:{},
  width: 300,
  dynamic: true,
  series:[
    {
      value:"#sales#",
      item:{
        borderColor: "#1293f8",
        color: "#ffffff"
      },
      line:{
        color:"#1293f8",
        width:3
      },
      tooltip:{
        template:"#sales#"
      }
    },
    {
      value:"#sales2#",
      item:{
        borderColor: "#66cc00",
        color: "#ffffff"
      },
      line:{
        color:"#66cc00",
        width:3
      },
      tooltip:{
        template:"#sales2#"
      }
    }
  ],
  item:{
    borderColor: "#1293f8",
    color: "#ffffff"
  }
};
var range = {
  view:"rangechart", height: 80, id:"range",
  type:"line",
  padding:0,
  series:[
    {
      value:"#sales#",
      item:{ radius: 0 },
      line:{
        color:"#1293f8",
        width:1
      }
    },
    {
      value:"#sales2#",
      item:{ radius: 0 },
      line:{
        color:"#66cc00",
        width:1
      }
    }
  ],
  frameId:"time",
  item: { radius :0 },
  data: data,
  on: {
    onAfterRangeChange:function(){
      $$("dchart").define("dynamic",false);
      $$("dchart").refresh();
      $$("dchart").clearAll();
      $$("dchart").parse(this.getFrameData());
    }
  },
  ready:function(){
    this.setFrameRange({start:30, end:40});
  }
};
webix.ui({
  //container:"chartDiv", type:"wide",
  rows:[
    chart,
    range
  ]
});

Unfortunately, this configuration won’t work. Thedynamic property provides the different initialization process and cannot be changed with a simplerefresh. As the fixedcellWidth is required for the dynamic chart, a newly loaded dataset may not fit the canvas.

In fact, the dynamic chart is not intended to be combined with the rangeChart due to mentioned situation. But can you please clarify your use-case?

I have a page with several charts for real-time monitoring plus rangecharts (one for each chart). I’d like that a user can pause a chart and use the rangechart for analyze stored data. I understand that I should replace the chart at each pause (static chart) and start (dynamic chart), right?

Thanks