vue-chart-engine
Version:
chart components built with Vue.js
50 lines (37 loc) • 1.23 kB
JavaScript
import ChartMaker from '../factory/gbasechart';
import * as DataManager from '../echart/echartData';
import BarChart from '../echart/barChart';
import ColumnChart from '../echart/columnChart';
import LineChart from '../echart/lineChart';
import AreaChart from '../echart/areaChart';
import PieChart from '../echart/pieChart';
import BubbleChart from '../echart/bubbleChart';
import GenreMaker from '../echart/genreMaker';
var EChart = class EChart extends ChartMaker {
draw(state){
$("#container").html("");
this.propsToVO(state.props);
this.chart = this.createChartByGenre(state);
this.setChartProperties();
}
setTitle(title){
this.title = title;
if(this.chart != "")
{
this.chart.setOption({title : {text : title}});
}
}
propsToVO(props){
this.title = props.title.value;
}
createChartByGenre(state){
var genre = state.chartInfo.chart.genre;
var subGenre = state.chartInfo.subChart.genre;
return GenreMaker.factory(genre).getChart(subGenre,"",state.etheme);
}
setChartProperties(props){
this.setTitle(this.title);
}
};
ChartMaker.EChart = EChart;
export var EChart;