Features

Trend Lines

Trend Lines

Trend lines are used to visualize trends in data and to help analyze the problems of prediction.

Features

Chart Types
Interaction
Analytics
BOXTrend Line01/23/1501/27/1501/29/1502/02/1502/04/1502/06/1502/10/1502/12/1502/17/1502/19/1502/23/1502/25/1502/27/1503/03/1503/05/1503/09/1503/11/1503/13/1503/17/1503/19/1503/23/1503/25/1503/27/1503/31/1504/02/1504/07/1504/09/1504/13/1504/15/1504/17/1504/21/1504/23/1504/27/1504/29/1505/01/1505/05/1505/07/1505/11/1505/13/1505/15/1505/19/1505/21/1505/26/1505/28/1520

Settings

Description

Trend lines are used to visualize trends in data and to help analyze the problems of prediction.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using FinancialChartExplorer.Models;
 
namespace FinancialChartExplorer.Controllers
{
    public partial class HomeController : Controller
    {
        public ActionResult TrendLine()
        {
            var model = BoxData.GetDataFromJson();
            ViewBag.DemoSettingsModel = new ClientSettingsModel() { Settings = CreateTrendLineSettings() };
            return View(model);
        }
 
        private static IDictionary<string, object[]> CreateTrendLineSettings()
        {
            var settings = new Dictionary<string, object[]>
            {
                {"Order", new object[]{"2","3","4","5","6","7","8","9"}},
                {"SampleCount", new object[]{"100","120","140","160","180","200"}},
                {"FitType", new object[]{"Linear","AverageX","AverageY","Exponential","Fourier","MaxX","MaxY","MinX","MinY","Polynomial"}},
            };
 
            return settings;
        }
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
@using FinancialChartExplorer.Models
 
@model List<FinanceData>
@{
    ViewBag.DemoSettings = true;
    ClientSettingsModel demoSettingsModel = ViewBag.DemoSettingsModel;
}
 
 
<script type="text/javascript">
    function customChangeOrder(control, value) {
        var trendLine = control.series[1];
        if (trendLine) {
            trendLine.order = +value;
        }
    }
 
    function customChangeSampleCount(control, value) {
        var trendLine = control.series[1];
        if (trendLine) {
            trendLine.sampleCount = +value;
        }
    }
 
    function customChangeFitType(control, value) {
        var trendLine = control.series[1];
        if (trendLine) {
            trendLine.fitType = wijmo.chart.analytics.TrendLineFitType[value];
        }
    }
 
</script>
 
 
@(Html.C1().FinancialChart()
.Id(demoSettingsModel.ControlId)
.Bind(Model)
.BindingX("X")
.ChartType(C1.Web.Mvc.Finance.ChartType.Line)
.Series(sers =>
    {
        sers.Add().Binding("Close").Name("BOX");
        sers.AddTrendLine().Binding("Close").FitType(C1.Web.Mvc.Chart.TrendLineFitType.Linear).Name("Trend Line");
    })
.Tooltip(t => t.Content("tooltip")))
 
 
@section Description{
    <p>
        Trend lines are used to visualize trends in data and to help analyze the problems of prediction.
    </p>
}
@section Summary{
    <p>
        Trend lines are used to visualize trends in data and to help analyze the problems of prediction.
    </p>
}