public static string OptionJsonString() { //这些只是进行初始化的信息,最后会被覆盖的; List <string> aaa = new List <string>(); //aaa.Add("想怎么配"); //aaa.Add("就怎么配"); legend legend = new legend(aaa); // 数据集; // 生成 series 里面的 data 数据 ( 重要 ); List <series> ser1 = new List <series>(); // 生成 xAxis 中的 data 属性 ( date 的格式很重要 ); string[] data = { "16:49:01", "16:49:02", "16:49:03", "16:49:04", "16:49:05", "16:49:06" }; xAxis xaxis = new xAxis(data); Option option = new Option(legend, ser1, xaxis); return(SCMTMainWindow.Option.ObjectToJson(option)); }
/// <summary> /// EChart中Option在C#当中的模型; /// </summary> /// <param name="legend"></param> /// <param name="series"></param> /// <param name="xAxis"></param> public Option(legend legend, List <series> series, xAxis xAxis) { this.legend = legend; this.series = series; this.xAxis = xAxis; }