HighChat dynamic data binding (2) and highchat binding

Source: Internet
Author: User

HighChat dynamic data binding (2) and highchat binding

I am also excited about the line chart in recent days. I have read many articles from my predecessors and summarized them.

1. Check the background program first. Some of the parameters I have simulated are strings. Nothing to say

 public ActionResult Index2()        {            string[] key = { "2017-08-01", "2017-08-02", "2017-08-03", "2017-08-04", "2017-08-05", "2017-08-06", "2017-08-07", "2017-08-08", "2017-08-09", "2017-08-10" };            double[] V1 = { 4.3, 1.2, 1.3, 1.6, 7.6, 5.9, 9.0, 22, 10, 11 };            double[] V2 = { 5.3, 1.9, 1.3, 1.4, 7.6, 0.4, 9.0, 22, 14, 12 };            string json = "{\"rows\":[";            for (int i = 0; i < key.Count(); i++)            {                json += "{\"atrname\":\"" + key[i] + "\",\"clickvalue\":\"" + V1[i] + "\",\"impvalue\":\"" + V2[i] + "\"},";            }            json = json.TrimEnd(',');            json += "]}";            return Content(json);        }

2. Data Binding at the front end

Method 1:

1. the header file contains the no-data-to-display.src.js file, indicating that if there is no data, it will automatically show no data

Lang: {noData: "No data"}, legend: {layout: 'vertical ', align: 'right', verticalAlign: 'middle', borderWidth: 0}

2. Please note that the current value of series: [{}] is like this, because if it is [], no data is displayed in this way.
// OOptions. series [0]. name = "third"; oOptions. series [0]. data = clickvalue;
3. var oSeries = {
// Name: "second entry", // data: clickvalue //}; // oChart. addSeries (oSeries );

When assigning values in this way, series: [{}] displays a line chart, but a line chart is displayed on the right. Series: [].
When assigning values in this way// OChart = new Highcharts. Chart (oOptions );To remove or put it on top for execution.
4. The third method is series: [] or series: [{}].

@ {Layout = null ;}<! DOCTYPE html> 

I will release my demo later. I hope you can correct me in the case of any errors and make progress together.

 

Download link: http://pan.baidu.com/s/1jHYFjE2

 

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.