Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

缺少 “VisualMap.cs” #6

Open
wangyl123 opened this issue Nov 26, 2017 · 2 comments
Open

缺少 “VisualMap.cs” #6

wangyl123 opened this issue Nov 26, 2017 · 2 comments

Comments

@wangyl123
Copy link

打开刚下载的“ECharts”项目后提示缺少 “VisualMap.cs” 文件额

@wangkiml
Copy link

wangkiml commented Dec 8, 2017

找不到VisualMap类文件

@wangyl123
Copy link
Author

其实ASP.NET MVC与Echart集成很简单的 ,只需要仿着Echart的数据结构,来编写后台类就可以了。
`
//前台js
option = {
color: [ '#4cabce', '#e5323e'],
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
title: {
text: '线体生产计划',
x: '20',
y:'10',
textStyle: {
fontSize: 20,
// align: 'center',
verticalAlign: 'middle'
}
},
legend: {
data: ['今日计划', '已完成数']
},
toolbox: {
show: true,
orient: 'vertical',
left: 'right',
top: 'center',
feature: {
mark: { show: true },
dataView: { show: true, readOnly: false },
magicType: { show: true, type: ['line', 'bar', 'stack', 'tiled'] },
restore: { show: true },
saveAsImage: { show: true }
}
},
calculable: true,
xAxis: [
{
type: 'category',
axisTick: { show: false },
data: ['A产品', 'B产品', 'C产品', 'D产品', 'E产品']
}
],
yAxis: [
{
type: 'value',
name: '数量',
nameLocation: 'end'
}
],
series: [

        {
            name: '今日计划',
            type: 'bar',
            label: labelOption,
            data: [150, 232, 201, 154, 190]
        },
        {
            name: '已完成数',
            type: 'bar',
            label: labelOption,
            data: [98, 77, 101, 99, 40]
        }
    ]
};

// 定时刷新
setInterval(function () {
$.ajax({
type: "POST",
url: "/DisplayBoardModule/WorkOrdelPlan/GetRTData",
//data: { MsgData: JSON.stringify(SubData) },
dataType: "json",
success: function (result) {
option.series = result;
option.series[0].label = labelOption;
option.series[1].label = labelOption;
}
});
myChart.setOption(option);
console.log("aaa");
}, 1000);

`

`//后台代码
// /DisplayBoardModule/WorkOrdelPlan/GetRTData
public ActionResult GetRTData()
{
List barSeriesData = new List();
BarSeries temp = new BarSeries()
{
name = "今日计划(今日)",
type = "bar",
};
BarSeries temp1 = new BarSeries()
{
name = "已完成数(今日)",
type = "bar",
};
barSeriesData.Add(temp);
barSeriesData.Add(temp1);

        List<int> data1 = new List<int>();
        data1.Add(20);
        data1.Add(50);
        data1.Add(60);
        data1.Add(80);
        barSeriesData[0].data = data1;
        data1.Clear();
        data1.Add(10);
        data1.Add(30);
        data1.Add(40);
        data1.Add(70);
        barSeriesData[1].data = data1;
        return Json(barSeriesData,JsonRequestBehavior.AllowGet);
    }

`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants