c# - Creating a Series based on the difference of 2 other Series in MS Charts -
2 series created in chart. create series (h) values values of 1st series (v1) minus values of 2nd series (s). can see s derived using financial formula. know how can create series h?
chartindicators.datasource = data; chartindicators.series["v1"].xvaluemember = "x"; chartindicators.series["v1"].yvaluemembers = "y1"; chartindicators.databind(); // transform macd chartindicators.datamanipulator.financialformula(financialformula.movingaverageconvergencedivergence, "v1"); // signal chartindicators.datamanipulator.financialformula(financialformula.exponentialmovingaverage, "9", "v1", "s");
can generate series h next datasets - if so, how can that? or there improve way this?
dataset dsv1 = chartindicators.datamanipulator.exportseriesvalues("v1"); dataset dss = chartindicators.datamanipulator.exportseriesvalues("s");
i found solution myself:
(int = 0; < dss.tables[0].defaultview.count;i++) { double y = convert.todouble(dsv1.tables[0].defaultview[i][1]) - convert.todouble(dss.tables[0].defaultview[i][1]); double x = convert.todatetime(dsv1.tables[0].defaultview[i][0]).tooadate(); chartindicators.series["h"].points.addxy(x, y); }
c# charts dataset mschart
No comments:
Post a Comment