Home > Back-end >  The problems about Echarts combined with jquery
The problems about Echarts combined with jquery

Time:12-30

 
<body>

<script>
Var myChart=echarts. Init ($(" # main "))//no, complains
//var myChart=echarts. Init (document. GetElementById (" main "));//can use the

//the specified configuration chart and data
Var option={
Title: {
Text: 'introductory ECharts example'
},
Tooltip: {},
Legend: {
Data: [' sales']
},
XAxis: {
Data: [" shirt "and" sweater ", "snow spins unlined upper garment", "pants", "high heels", "socks"]
},
YAxis: {},
Series: [{
Name: 'sales'
Type: 'bar',
Data: [5, 20, 36, 10, 10, 20]
}]
};

//use the specified configuration items and data display chart,
myChart.setOption(option);

</script>



This is the first case, why do I not get dom elements with jq, use native js no problem? Don't I want to by jq for the dom to js object to it

CodePudding user response:

Others define interfaces to what you will give what bai

CodePudding user response:

Stick your code out and have a look

CodePudding user response:

All x, because the echarts stipulated incoming js object inside, and I use $to get dom object incoming is a jquery object, that how to do?
The jquery object into a js object, behind. Get (0) or add [0]
  • Related