Features

Point and Figure

Point and Figure

Point and Figure chart consists of columns of X's and O's that represent filtered price movements.

Features

Chart Types
Interaction
Analytics
FB758085

Settings

Description

Point and Figure chart consists of columns of X's and O's that represent filtered price movements. X-Columns represent rising prices and O-Columns represent falling prices.

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
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 PointAndFigure()
        {
            ViewBag.FbData = FbData.GetDataFromJson();
            ViewBag.RsData = FbData.GetReativeStrengthDataFromJson();
            ViewBag.DemoSettingsModel = new ClientSettingsModel() { Settings = CreatePointAndFigureSettings(), DefaultValues = CreatePointAndFigureDefaultValues() };
            return View();
        }
 
        private static IDictionary<string, object[]> CreatePointAndFigureSettings()
        {
            var settings = new Dictionary<string, object[]>
            {
                {"Fields", new object[]{"HighLow","Close"}},
                {"Reversal", new object[]{"2","3","4","5"}},
                {"Scaling", new object[]{"Traditional", "Fixed", "Dynamic"}},
                {"BoxSize", new object[]{"1","2","3","4","5"}},
                {"Period", new object[]{"10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30"}},
                {"Stroke", new object[]{"LightBlue","Red", "Green", "Blue","Black","Purple","Yellow","Orange","Silver","Brown"}},
                {"AltStroke", new object[]{"LightBlue","Red", "Green", "Blue","Black","Purple","Yellow","Orange","Silver","Brown"}},
            };
 
            return settings;
        }
 
        private static IDictionary<string, object> CreatePointAndFigureDefaultValues()
        {
            return new Dictionary<string, object>
            {
                { "Reversal", "3" },
                { "Period", "20" },
                { "Stroke", "Black" },
                { "AltStroke", "Red" }
            };
        }
    }
}
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
@using FinancialChartExplorer.Models
 
@{
    IEnumerable<FinanceData> fbData = ViewBag.FbData;
    IEnumerable<FinanceData> rsData = ViewBag.RsData;
    ViewBag.DemoSettings = true;
    ClientSettingsModel demoSettingsModel = ViewBag.DemoSettingsModel;
}
 
 
    <script type="text/javascript">
 
        c1.documentReady(function () {
            var scaling = wijmo.Control.getControl('#Scaling');
            var boxSize = wijmo.Control.getControl('#BoxSize');
            var period = wijmo.Control.getControl('#Period');
 
            function updateStatus(s) {
                boxSize.isDisabled = s.selectedIndex != 1;
                period.isDisabled = s.selectedIndex != 2;
            }
 
            updateStatus(scaling);
            scaling.selectedIndexChanged.addHandler(function (s, e) {
                updateStatus(s);
            });
 
            function updateX(cv) {
                var items = cv.sourceCollection;
                for (var i = 0; i < items.length; i++) {
                    var item = items[i];
                    item['X'] = wijmo.Globalize.parseDate(item['X'], "yyyy-MM-dd");
                }
            }
 
            updateX(c1.getService("cvFb"));
            updateX(c1.getService("cvRs"));
        });
 
        function customChangeFields(control, value) {
            var options = getPointAndFigureOptions(control);
            options.fields = wijmo.chart.finance.DataFields[value];
            control.invalidate();
        }
 
        function customChangeReversal(control, value) {
            var options = getPointAndFigureOptions(control);
            options.reversal = +value;
            control.invalidate();
        }
 
        function customChangeScaling(control, value) {
            var options = getPointAndFigureOptions(control);
            options.scaling = wijmo.chart.finance.PointAndFigureScaling[value];
            control.invalidate();
        }
 
        function customChangeBoxSize(control, value) {
            var options = getPointAndFigureOptions(control);
            options.boxSize = +value;
            control.invalidate();
        }
 
        function customChangePeriod(control, value) {
            var options = getPointAndFigureOptions(control);
            options.period = +value;
            control.invalidate();
        }
 
        function getPointAndFigureOptions(control) {
            var options = control.options;
            if (!options) {
                options = control.options = {};
            }
 
            var pointAndFigure = options.pointAndFigure;
            if (!pointAndFigure) {
                pointAndFigure = options.pointAndFigure = {};
            }
 
            return pointAndFigure;
        }
 
        function customChangeStroke(control, value) {
            setColor(control, "style", "stroke", value);
        }
 
        function customChangeAltStroke(control, value) {
            setColor(control, "altStyle", "stroke", value);
        }
 
        function setColor(control, styleName, attName, value) {
            control.series[0][styleName][attName] = value;
            control.invalidate();
        }
 
        function changeStockData(menu) {
            var chart = wijmo.Control.getControl('#@demoSettingsModel.ControlId');
            var fields = wijmo.Control.getControl('#Fields');
 
            // update header
            menu.header = "@Html.Raw(Resources.Home.PointAndFigure_StockData) <b>" + menu.selectedItem.Header + "</b>";
 
            // change the items source and default fields setting
            var value = menu.selectedItem.CommandParameter;
            switch (value) {
                case "rs":
                    chart.itemsSource = c1.getService("cvRs");
                    fields.selectedIndex = 1;
                    break;
                case "fb":
                default:
                    chart.itemsSource = c1.getService("cvFb");
                    fields.selectedIndex = 0;
                     
                    break;
            }
 
            // update fields
            changeFields(fields);
        }
    </script>
 
     @Html.C1().Menu().Id("stockData").Header(Resources.Home.PointAndFigure_StockData + " <b>" + Resources.Home.PointAndFigure_FacebookIncFB + "</b>").MenuItems(items =>
            {
                items.Add().Header(Resources.Home.PointAndFigure_FacebookIncFB).CommandParameter("fb");
                items.Add().Header(Resources.Home.PointAndFigure_FBRelativeToNASDAQNDX).CommandParameter("rs");
            }).OnClientItemClicked("changeStockData")
 
    @Html.C1().CollectionViewService().Id("cvFb").Bind(fbData)
    @Html.C1().CollectionViewService().Id("cvRs").Bind(rsData)
 
    @(Html.C1().FinancialChart()
        .Id(demoSettingsModel.ControlId)
        .ItemsSourceId("cvFb")
        .BindingX("X")
        .ChartType(C1.Web.Mvc.Finance.ChartType.PointAndFigure)
        .Options(o =>
        {
            o.PointAndFigureFields(C1.Web.Mvc.Finance.DataFields.HighLow);
            o.PointAndFigureReversal(3);
            o.PointAndFigureScaling(C1.Web.Mvc.Finance.PointAndFigureScaling.Traditional);
            o.PointAndFigureBoxSize(1);
            o.PointAndFigurePeriod(20);
        })
        .Series(sers =>
        {
            sers.Add().Binding("High,Low,Open,Close").Name("FB").Style(s => s.Stroke("Black")).AltStyle(s => s.Stroke("Red"));
        })
        .Tooltip(t => t.Content("{x:d}<br/>{y}")))
 
    @section Description{
        <p>@Html.Raw(Resources.Home.PointAndFigure_Text0)</p>
    }
    @section Summary{
        <p>@Html.Raw(Resources.Home.PointAndFigure_Text1)</p>
    }