Comments (4)
上代码?require图表了吗?如果出了各种控件就图表没出来,90%是这个问题,特别是单文件引入时也应该像这样,保持跟按需加载一样的格式,把要的图表也显式require,这样所需图表类型才被注册的库中,才能出图表
require([
'echarts',
'echarts/chart/pie'
],...)
from echarts.
var InitPieChart = function (Id, data) {
var affiliateChartOptions = function () {
var tempOptions = {
tooltip: {
trigger: 'item',
formatter: "{b} : {c} ({d}%)"
},
legend: {
orient: 'vertical',
x: 'left',
data: []
},
toolbox: {
show: true,
feature: {
restore: true
},
padding: [5, 50, 5, 5]
},
series: [
{
name: $("#" + Id).attr("data-title"),
type: "pie",
radius: [0, 100],
data: [
],
itemStyle: {
normal: {
label: {
show: false,
formatter: "{b}"
},
labelLine: {
show: false,
}
}
}
}
]
};
var total = 0;
$.each(data, function (name, value) {
name = name.ReplaceAll("_", " ");
tempOptions.legend.data.push(name);
tempOptions.series[0].data.push({ name: name, value: value.Count });
total += value.Count;
});
tempOptions.legend.data = tempOptions.legend.data.sort(function (item1, item2) {
return item2.length - item1.length;
});
tempOptions.series[0].data = tempOptions.series[0].data.sort(function (item1, item2) {
return item2.name.length - item1.name.length;
});
$("#" + Id + "Total").html(total);
return tempOptions;
}();
var charts;
require(['echarts/echarts', 'echarts/chart/pie'],
function (ec, wd) {
charts = ec;
charts = charts.init($("#" + Id).get(0));
charts.refresh();
charts.setOption(affiliateChartOptions);
}
);
};
正常请求都没有问题,有时候加载不出,tools、legend也都没出来,我跟过http请求,有时候会停在请求完某些zrender的js之后。
from echarts.
了解,谢谢,我看看~
from echarts.
问题已经查出来了。。。 是我自己的代码有问题。。。
对不住大神了。。。。
from echarts.
Related Issues (20)
- [Bug] The issue of occupying space in the non displayed part of a semicircle pie chart HOT 1
- [Feature] echarts多个柱状图如何只显示单个markLine HOT 4
- [Feature] Implement mobile dataZoom-Inside to horizontally scale only the xAxis with gestures and vertically scale only the yAxis with gestures.
- [Bug] 散点图覆盖地图时,使用dataset指定更新散点图数据失效 HOT 5
- [Feature] 为树状图添加x轴,y轴和极坐标轴支持,使图表可以同时反应分支关系和节点属性 HOT 2
- [Bug] 饼图中的数据出现重名不会自动合计 HOT 2
- no events are trigger when hover on the area chart and stacked area chart HOT 1
- [Bug] When a bar type series, xAxis of type time display wrong dates
- [Feature] - add label position to the data-zoom slider HOT 1
- [Bug] render is slow when yAxis.type=time and yAxis.max is less then the min of data HOT 4
- [Bug] rich align not work HOT 3
- Expandable Heat Map
- [Bug] resize and bargraph highlight HOT 3
- [Bug] Support on CSS Variables for color property on charts HOT 3
- [Bug] The line with animation will jitter during rendering. HOT 6
- [Bug] Vue3项目中引入echarts会有isFunction is not a function问题 HOT 2
- [Bug] Icon base 64 background image in label no work HOT 2
- K线图,下面的volume柱状图,可以再添加一组图吗 HOT 3
- [Bug] HOT 1
- [Bug] Not Able To Add 'Bin Width' and 'Number Of Bars' In 'x-axis' For Histogram and Not Able To 'See' Histogram Plotted Sometimes in Echarts HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from echarts.