<UserControl x:Class="Abt.Controls.SciChart.Example.Examples.IWantTo.CreateMultiseriesChart.CandlestickWithLinesView" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:s="http://schemas.abtsoftware.co.uk/scichart" d:DesignHeight="300" d:DesignWidth="300" Loaded="CandlesticksWithLines_Loaded" mc:Ignorable="d">

<s:SciChartSurface x:Name="sciChart" s:ThemeManager.Theme="Chrome">

<s:SciChartSurface.RenderableSeries>
<!-- Candlestick bodies now support gradients as well as solid colours -->
<s:FastCandlestickRenderableSeries>
<s:FastCandlestickRenderableSeries.UpBodyBrush>
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
<GradientStop Offset="0" Color="#55002200"/>
<GradientStop Offset="1" Color="#FF00AA00"/>
</LinearGradientBrush>
</s:FastCandlestickRenderableSeries.UpBodyBrush>
<s:FastCandlestickRenderableSeries.DownBodyBrush>
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
<GradientStop Offset="0" Color="#55441111"/>
<GradientStop Offset="1" Color="#FFFF0000"/>
</LinearGradientBrush>
</s:FastCandlestickRenderableSeries.DownBodyBrush>
</s:FastCandlestickRenderableSeries>
<s:FastLineRenderableSeries SeriesColor="#FF1919"/>
<s:FastLineRenderableSeries SeriesColor="#1964FF"/>
<s:FastLineRenderableSeries SeriesColor="#FF9B27"/>
</s:SciChartSurface.RenderableSeries>

<s:SciChartSurface.XAxis>
<s:CategoryDateTimeAxis GrowBy="0.0, 0.2"/>
</s:SciChartSurface.XAxis>

<s:SciChartSurface.YAxis>
<s:NumericAxis GrowBy="0.1, 0.1"/>
</s:SciChartSurface.YAxis>

<s:SciChartSurface.ChartModifier>
<s:ModifierGroup x:Name="_groupModifier">
<s:ZoomPanModifier XyDirection="XDirection"/>
<s:ZoomExtentsModifier ExecuteOn="MouseDoubleClick"/>
</s:ModifierGroup>
</s:SciChartSurface.ChartModifier>

</s:SciChartSurface>

</UserControl>

______

using System;
using System.Windows;
using System.Windows.Controls;
using Abt.Controls.SciChart.Example.Common;
using Abt.Controls.SciChart.Example.Data;
using Abt.Controls.SciChart.Model.DataSeries;

namespace Abt.Controls.SciChart.Example.Examples.IWantTo.CreateMultiseriesChart
{
public partial class CandlestickWithLinesView : UserControl
{
public CandlestickWithLinesView()
{
InitializeComponent();
}

private void CandlesticksWithLines_Loaded(object sender, RoutedEventArgs e)
{
// Create multiple DataSeries to store OHLC candlestick data, and Xy moving average data
var dataSeries0 = new OhlcDataSeries<DateTime, double>();
var dataSeries1 = new XyDataSeries<DateTime, double>();
var dataSeries2 = new XyDataSeries<DateTime, double>();
var dataSeries3 = new XyDataSeries<DateTime, double>();

// Prices are in the format Time, Open, High, Low, Close (all IList)
var prices = DataManager.Instance.GetPriceData(Instrument.Indu.Value, TimeFrame.Daily);

// Append data to series.
// First series is rendered as a Candlestick Chart so we append OHLC data
dataSeries0.Append(prices.TimeData, prices.OpenData, prices.HighData, prices.LowData, prices.CloseData);

// Subsequent series append moving average of the close prices
dataSeries1.Append(prices.TimeData, DataManager.Instance.ComputeMovingAverage(prices.CloseData, 100));
dataSeries2.Append(prices.TimeData, DataManager.Instance.ComputeMovingAverage(prices.CloseData, 50));
dataSeries3.Append(prices.TimeData, DataManager.Instance.ComputeMovingAverage(prices.CloseData, 20));

sciChart.RenderableSeries[0].DataSeries = dataSeries0;
sciChart.RenderableSeries[1].DataSeries = dataSeries1;
sciChart.RenderableSeries[2].DataSeries = dataSeries2;
sciChart.RenderableSeries[3].DataSeries = dataSeries3;

sciChart.ZoomExtents();
}
}
}

scichart by Kline的更多相关文章

  1. android 企业级高性能图表库 SciChart (付费)

    1.官网 https://www.scichart.com/ 2.特性 2.1 链接 https://www.scichart.com/android-chart-features/ https:// ...

  2. 小白学Python(14)——pyecharts 绘制K线图 Kline/Candlestick

    Kline-基本示例 from pyecharts import options as opts from pyecharts.charts import Kline data = [ [2320.2 ...

  3. python kline

    # -*- coding: utf-8 -*- # Qt相关和十字光标 from qtpy.QtGui import * from qtpy.QtCore import * from qtpy imp ...

  4. RealTimePerformanceDemoView

    using System;using System.Diagnostics;using System.Timers;using System.Windows;using System.Windows. ...

  5. 一些对数学领域及数学研究的个人看法(转载自博士论坛wcboy)

    转自:http://www.math.org.cn/forum.php?mod=viewthread&tid=14819&extra=&page=1 原作者: wcboy 现在 ...

  6. irc操作小记

    IRC客户端 HexChat 跨平台支持,目前正在Windows上使用,暂无不满意的地方 polari 支持的命令太少了,功能有限. Empathy 重量级,支持各种消息协议 weechat/irss ...

  7. Java性能提示(全)

    http://www.onjava.com/pub/a/onjava/2001/05/30/optimization.htmlComparing the performance of LinkedLi ...

  8. Android自定义View绘图实现拖影动画

    前几天在"Android绘图之渐隐动画"一文中通过画线实现了渐隐动画,但里面有个问题,画笔较粗(大于1)时线段之间会有裂隙,我又改进了一下.这次效果好多了. 先看效果吧: 然后我们 ...

  9. 股票k线

    与上一篇文章相比k线图主要的难点 1.tooltip的定制化显示: 当手指触摸手机屏幕上下拖动可能会手指的事件陷入图表无法进行上下拖动 tooltip:{followMouseMove} follow ...

随机推荐

  1. Windows下安装openssl

    安装python类库cryptography1.6提示 build\temp.win-amd64-2.7\Release\_openssl.c(429): fatal error C1083: Can ...

  2. Hadoop集群搭建安装过程(一)(图文详解---尽情点击!!!)

    Hadoop集群搭建(一)(上篇中讲到了Linux虚拟机的安装) 一.安装所需插件(以hadoop2.6.4为例,如果需要可以到官方网站进行下载:http://hadoop.apache.org) h ...

  3. (转) Spring框架笔记(二十五)——NamedParameterJdbcTemplate与具名参数(转)

    在经典的 JDBC 用法中, SQL 参数是用占位符 ? 表示,并且受到位置的限制. 定位参数的问题在于, 一旦参数的顺序发生变化, 就必须改变参数绑定. 在 Spring JDBC 框架中, 绑定 ...

  4. 如何换ionic里面的图标

    (转自http://www.zcool.com.cn/article/ZMTM4NDQw.html) 第一步,你把你的项目的SVG文件跟你自己做的图标的SVG文件都上到icomoon.io/app(上 ...

  5. 【Django】Django web项目部署(Nginx+uwsgi)

    一.安装uwsgi 通过pip安装uwsgi. pip install uwsgi 测试uwsgi,创建test.py文件: def application(env, start_response): ...

  6. C++转义字符

    R"()"括号中间的字符串可以去掉转义字符

  7. cocos2dx 3.x tolua 分析

    cocos2dx 3.x 版本已经出到3.10了,终于决定要进行引擎版本升级,c++配合lua进行游戏开发,从3.x版本开始cocos使用了新的tolua方式,由于不懂python,折腾tolua搞的 ...

  8. git subtree 使用

    这个是备忘录.原网页(https://medium.com/@porteneuve/mastering-git-subtrees-943d29a798ec , http://cncc.bingj.co ...

  9. 2016HUAS_ACM暑假集训4C - 递推

    题目大意:给你一个高为n ,宽为m列的网格,计算出这个网格中有多少个矩形. 这里我们可以这样看: 对于行:假如是m单位长度,则长度为1的矩形有m个,长度为2的矩形有m-1个......长度为m的只有1 ...

  10. Java Concurrent之 AbstractQueuedSynchronizer

    ReentrantLock/CountDownLatch/Semaphore/FutureTask/ThreadPoolExecutor的源码中都会包含一个静态的内部类Sync,它继承了Abstrac ...