https://www.wikipedia.org/
Feel free to share demo-related thoughts here.
If you have technical questions, please create a support ticket in the DevExpress Support Center.
Thank you for the feedback!
If you have technical questions, please create a support ticket in the DevExpress Support Center.
Backend API
@(Html.DevExtreme().Chart()
.ID("chart")
.Title(t => t.Text("Apple Stock Price").Subtitle("AAPL"))
.Legend(l => l.Visible(false))
.Series(s => s
.Add()
.Name("AAPL")
.ValueField("Close")
.ArgumentField("Date")
.Type(SeriesType.Line)
)
.ValueAxis(a => a
.Add()
.Position(Position.Right)
)
.ArgumentAxis(a => a
.ArgumentType(ChartDataType.DateTime)
)
.CommonAnnotationSettings(s => s
.Series("AAPL")
.Type(AnnotationType.Image)
.Font(f => f
.Size(16)
.Weight(600)
)
.Image(i => i
.Width(50.5)
.Height(105.75)
)
.CustomizeTooltip(@<text>
function (e) {
return {
html: $("<div class='tooltip'>").
appendTo($("<div>")).
text(e.description).
parent().html()
};
}
</text>)
)
.Annotations(a => {
a.Add()
.Argument(new DateTime(2016, 3, 31))
.Description("The iPhone SE (Special Edition) is a smartphone that was designed and marketed by Apple Inc. It is part of the ninth generation of the iPhone alongside the iPhone 6S. It was announced on March 21, 2016 at the Town Hall auditorium in the Apple Campus by Apple executive Greg Joswiak, with pre-orders beginning on March 24, and official release on March 31, 2016. It was re-released almost a year later on March 24, 2017 with larger storage capacities. The iPhone SE shares the same physical design and dimensions as the iPhone 5S, but has upgraded internal hardware, including the newer Apple A9 system-on-chip, greater battery capacity, and a 12-megapixel rear camera that can record 4K video. Along with the iPhone 6S and the iPhone X, the iPhone SE was discontinued by Apple on September 12, 2018")
.Image(i => i.Url("../../Content/Images/Charts/Annotation/iphone-se.png"));
a.Add()
.Argument(new DateTime(2017, 11, 3))
.OffsetY(110)
.Description("iPhone X (Roman numeral 'X' pronounced 'ten') is a smartphone designed, developed, and marketed by Apple Inc. It was the eleventh generation of the iPhone. It was announced on September 12, 2017, alongside the iPhone 8 and iPhone 8 Plus, at the Steve Jobs Theater in the Apple Park campus. The phone was released on November 3, 2017, marking the iPhone series' tenth anniversary.")
.Image(i => i.Url("../../Content/Images/Charts/Annotation/iphone-x.png"));
a.Add()
.Argument(new DateTime(2015, 4, 24))
.PaddingTopBottom(5)
.Description("Apple Watch is a line of smartwatches designed, developed, and marketed by Apple Inc. It incorporates fitness tracking and health-oriented capabilities with integration with iOS and other Apple products and services. The Apple Watch was released on April 24, 2015 and quickly became the best-selling wearable device with 4.2 million sold in the second quarter of the 2015 fiscal year.")
.Image(i => i.Url("../../Content/Images/Charts/Annotation/apple-watch.png"));
a.Add()
.Type(AnnotationType.Text)
.Argument(new DateTime(2017, 6, 5))
.Description("The Apple Worldwide Developers Conference was held from June 5 to June 9, 2017 at the San Jose Convention Center in San Jose, California, which was the first time since 2002 that the conference took place in the city.Software announcements included iOS 11, watchOS 4, macOS High Sierra, and updates to tvOS.Hardware announcements included updates to iMac, MacBook and MacBook Pro, as well as the new iMac Pro, 10.5 - inch iPad Pro and smart speaker HomePod.Fall Out Boy performed at the Bash held in Discovery Meadow on June 8")
.Text("WWDC 2017");
a.Add()
.Type(AnnotationType.Text)
.Argument(new DateTime(2019, 3, 25))
.Description("Apple TV+ is an upcoming over-the-top ad-free subscription video on demand web television service announced by Apple Inc. in 2019 during their March 25 Apple Special Event held at Steve Jobs Theater")
.Text("Apple TV+ announced");
})
.DataSource(Model)
)
using DevExtreme.AspNet.Data;
using DevExtreme.AspNet.Mvc;
using DevExtreme.MVC.Demos.Models.SampleData;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
namespace DevExtreme.MVC.Demos.Controllers {
public class ChartsController : Controller {
public ActionResult Annotation() {
return View(SampleData.AnnotationData);
}
}
}
using System.Collections.Generic;
namespace DevExtreme.MVC.Demos.Models.SampleData {
public partial class SampleData {
public static readonly IEnumerable<object> AnnotationData = new[] {
new { Date = "2014-12-29", Close = 109.330002 },
new { Date = "2015-01-05", Close = 112.010002 },
new { Date = "2015-01-12", Close = 105.989998 },
new { Date = "2015-01-19", Close = 112.980003 },
new { Date = "2015-01-26", Close = 117.160004 },
new { Date = "2015-02-02", Close = 118.93 },
new { Date = "2015-02-09", Close = 127.080002 },
new { Date = "2015-02-16", Close = 129.5 },
new { Date = "2015-02-23", Close = 128.460007 },
new { Date = "2015-03-02", Close = 126.599998 },
new { Date = "2015-03-09", Close = 123.589996 },
new { Date = "2015-03-16", Close = 125.900002 },
new { Date = "2015-03-23", Close = 123.25 },
new { Date = "2015-03-30", Close = 125.32 },
new { Date = "2015-04-06", Close = 127.099998 },
new { Date = "2015-04-13", Close = 124.75 },
new { Date = "2015-04-20", Close = 130.279999 },
new { Date = "2015-04-27", Close = 128.949997 },
new { Date = "2015-05-04", Close = 127.620003 },
new { Date = "2015-05-11", Close = 128.770004 },
new { Date = "2015-05-18", Close = 132.539993 },
new { Date = "2015-05-25", Close = 130.279999 },
new { Date = "2015-06-01", Close = 128.649994 },
new { Date = "2015-06-08", Close = 127.169998 },
new { Date = "2015-06-15", Close = 126.599998 },
new { Date = "2015-06-22", Close = 126.75 },
new { Date = "2015-06-29", Close = 126.440002 },
new { Date = "2015-07-06", Close = 123.279999 },
new { Date = "2015-07-13", Close = 129.619995 },
new { Date = "2015-07-20", Close = 124.5 },
new { Date = "2015-07-27", Close = 121.300003 },
new { Date = "2015-08-03", Close = 115.519997 },
new { Date = "2015-08-10", Close = 115.959999 },
new { Date = "2015-08-17", Close = 105.760002 },
new { Date = "2015-08-24", Close = 113.290001 },
new { Date = "2015-08-31", Close = 109.269997 },
new { Date = "2015-09-07", Close = 114.209999 },
new { Date = "2015-09-14", Close = 113.449997 },
new { Date = "2015-09-21", Close = 114.709999 },
new { Date = "2015-09-28", Close = 110.379997 },
new { Date = "2015-10-05", Close = 112.120003 },
new { Date = "2015-10-12", Close = 111.040001 },
new { Date = "2015-10-19", Close = 119.080002 },
new { Date = "2015-10-26", Close = 119.5 },
new { Date = "2015-11-02", Close = 121.059998 },
new { Date = "2015-11-09", Close = 112.339996 },
new { Date = "2015-11-16", Close = 119.300003 },
new { Date = "2015-11-23", Close = 117.809998 },
new { Date = "2015-11-30", Close = 119.029999 },
new { Date = "2015-12-07", Close = 113.18 },
new { Date = "2015-12-14", Close = 106.029999 },
new { Date = "2015-12-21", Close = 108.029999 },
new { Date = "2015-12-28", Close = 105.260002 },
new { Date = "2016-01-04", Close = 96.959999 },
new { Date = "2016-01-11", Close = 97.129997 },
new { Date = "2016-01-18", Close = 101.419998 },
new { Date = "2016-01-25", Close = 97.339996 },
new { Date = "2016-02-01", Close = 94.019997 },
new { Date = "2016-02-08", Close = 93.989998 },
new { Date = "2016-02-15", Close = 96.040001 },
new { Date = "2016-02-22", Close = 96.910004 },
new { Date = "2016-02-29", Close = 103.010002 },
new { Date = "2016-03-07", Close = 102.260002 },
new { Date = "2016-03-14", Close = 105.919998 },
new { Date = "2016-03-21", Close = 105.669998 },
new { Date = "2016-03-28", Close = 109.989998 },
new { Date = "2016-04-04", Close = 108.660004 },
new { Date = "2016-04-11", Close = 109.849998 },
new { Date = "2016-04-18", Close = 105.68 },
new { Date = "2016-04-25", Close = 93.739998 },
new { Date = "2016-05-02", Close = 92.720001 },
new { Date = "2016-05-09", Close = 90.519997 },
new { Date = "2016-05-16", Close = 95.220001 },
new { Date = "2016-05-23", Close = 100.349998 },
new { Date = "2016-05-30", Close = 97.919998 },
new { Date = "2016-06-06", Close = 98.830002 },
new { Date = "2016-06-13", Close = 95.330002 },
new { Date = "2016-06-20", Close = 93.400002 },
new { Date = "2016-06-27", Close = 95.889999 },
new { Date = "2016-07-04", Close = 96.68 },
new { Date = "2016-07-11", Close = 98.779999 },
new { Date = "2016-07-18", Close = 98.660004 },
new { Date = "2016-07-25", Close = 104.209999 },
new { Date = "2016-08-01", Close = 107.480003 },
new { Date = "2016-08-08", Close = 108.18 },
new { Date = "2016-08-15", Close = 109.360001 },
new { Date = "2016-08-22", Close = 106.940002 },
new { Date = "2016-08-29", Close = 107.730003 },
new { Date = "2016-09-05", Close = 103.129997 },
new { Date = "2016-09-12", Close = 114.919998 },
new { Date = "2016-09-19", Close = 112.709999 },
new { Date = "2016-09-26", Close = 113.050003 },
new { Date = "2016-10-03", Close = 114.059998 },
new { Date = "2016-10-10", Close = 117.629997 },
new { Date = "2016-10-17", Close = 116.599998 },
new { Date = "2016-10-24", Close = 113.720001 },
new { Date = "2016-10-31", Close = 108.839996 },
new { Date = "2016-11-07", Close = 108.43 },
new { Date = "2016-11-14", Close = 110.059998 },
new { Date = "2016-11-21", Close = 111.790001 },
new { Date = "2016-11-28", Close = 109.900002 },
new { Date = "2016-12-05", Close = 113.949997 },
new { Date = "2016-12-12", Close = 115.970001 },
new { Date = "2016-12-19", Close = 116.519997 },
new { Date = "2016-12-26", Close = 115.82 },
new { Date = "2017-01-02", Close = 117.910004 },
new { Date = "2017-01-09", Close = 119.040001 },
new { Date = "2017-01-16", Close = 120.0 },
new { Date = "2017-01-23", Close = 121.949997 },
new { Date = "2017-01-30", Close = 129.080002 },
new { Date = "2017-02-06", Close = 132.119995 },
new { Date = "2017-02-13", Close = 135.720001 },
new { Date = "2017-02-20", Close = 136.660004 },
new { Date = "2017-02-27", Close = 139.779999 },
new { Date = "2017-03-06", Close = 139.139999 },
new { Date = "2017-03-13", Close = 139.990005 },
new { Date = "2017-03-20", Close = 140.639999 },
new { Date = "2017-03-27", Close = 143.660004 },
new { Date = "2017-04-03", Close = 143.339996 },
new { Date = "2017-04-10", Close = 141.050003 },
new { Date = "2017-04-17", Close = 142.270004 },
new { Date = "2017-04-24", Close = 143.649994 },
new { Date = "2017-05-01", Close = 148.960007 },
new { Date = "2017-05-08", Close = 156.100006 },
new { Date = "2017-05-15", Close = 153.059998 },
new { Date = "2017-05-22", Close = 153.610001 },
new { Date = "2017-05-29", Close = 155.449997 },
new { Date = "2017-06-05", Close = 148.979996 },
new { Date = "2017-06-12", Close = 142.270004 },
new { Date = "2017-06-19", Close = 146.279999 },
new { Date = "2017-06-26", Close = 144.020004 },
new { Date = "2017-07-03", Close = 144.179993 },
new { Date = "2017-07-10", Close = 149.039993 },
new { Date = "2017-07-17", Close = 150.270004 },
new { Date = "2017-07-24", Close = 149.5 },
new { Date = "2017-07-31", Close = 156.389999 },
new { Date = "2017-08-07", Close = 157.479996 },
new { Date = "2017-08-14", Close = 157.5 },
new { Date = "2017-08-21", Close = 159.860001 },
new { Date = "2017-08-28", Close = 164.050003 },
new { Date = "2017-09-04", Close = 158.630005 },
new { Date = "2017-09-11", Close = 159.880005 },
new { Date = "2017-09-18", Close = 151.889999 },
new { Date = "2017-09-25", Close = 154.119995 },
new { Date = "2017-10-02", Close = 155.300003 },
new { Date = "2017-10-09", Close = 156.990005 },
new { Date = "2017-10-16", Close = 156.25 },
new { Date = "2017-10-23", Close = 163.050003 },
new { Date = "2017-10-30", Close = 172.5 },
new { Date = "2017-11-06", Close = 174.669998 },
new { Date = "2017-11-13", Close = 170.149994 },
new { Date = "2017-11-20", Close = 174.970001 },
new { Date = "2017-11-27", Close = 171.050003 },
new { Date = "2017-12-04", Close = 169.369995 },
new { Date = "2017-12-11", Close = 173.970001 },
new { Date = "2017-12-18", Close = 175.009995 },
new { Date = "2017-12-25", Close = 169.229996 },
new { Date = "2018-01-01", Close = 175.0 },
new { Date = "2018-01-08", Close = 177.089996 },
new { Date = "2018-01-15", Close = 178.460007 },
new { Date = "2018-01-22", Close = 171.509995 },
new { Date = "2018-01-29", Close = 160.5 },
new { Date = "2018-02-05", Close = 156.410004 },
new { Date = "2018-02-12", Close = 172.429993 },
new { Date = "2018-02-19", Close = 175.5 },
new { Date = "2018-02-26", Close = 176.210007 },
new { Date = "2018-03-05", Close = 179.979996 },
new { Date = "2018-03-12", Close = 178.020004 },
new { Date = "2018-03-19", Close = 164.940002 },
new { Date = "2018-03-26", Close = 167.779999 },
new { Date = "2018-04-02", Close = 168.380005 },
new { Date = "2018-04-09", Close = 174.729996 },
new { Date = "2018-04-16", Close = 165.720001 },
new { Date = "2018-04-23", Close = 162.320007 },
new { Date = "2018-04-30", Close = 183.830002 },
new { Date = "2018-05-07", Close = 188.589996 },
new { Date = "2018-05-14", Close = 186.309998 },
new { Date = "2018-05-21", Close = 188.580002 },
new { Date = "2018-05-28", Close = 190.240005 },
new { Date = "2018-06-04", Close = 191.699997 },
new { Date = "2018-06-11", Close = 188.839996 },
new { Date = "2018-06-18", Close = 184.919998 },
new { Date = "2018-06-25", Close = 185.110001 },
new { Date = "2018-07-02", Close = 187.970001 },
new { Date = "2018-07-09", Close = 191.330002 },
new { Date = "2018-07-16", Close = 191.440002 },
new { Date = "2018-07-23", Close = 190.979996 },
new { Date = "2018-07-30", Close = 207.990005 },
new { Date = "2018-08-06", Close = 207.529999 },
new { Date = "2018-08-13", Close = 217.580002 },
new { Date = "2018-08-20", Close = 216.160004 },
new { Date = "2018-08-27", Close = 227.630005 },
new { Date = "2018-09-03", Close = 221.300003 },
new { Date = "2018-09-10", Close = 223.839996 },
new { Date = "2018-09-17", Close = 217.660004 },
new { Date = "2018-09-24", Close = 225.740005 },
new { Date = "2018-10-01", Close = 224.289993 },
new { Date = "2018-10-08", Close = 222.110001 },
new { Date = "2018-10-15", Close = 219.309998 },
new { Date = "2018-10-22", Close = 216.300003 },
new { Date = "2018-10-29", Close = 207.479996 },
new { Date = "2018-11-05", Close = 204.470001 },
new { Date = "2018-11-12", Close = 193.529999 },
new { Date = "2018-11-19", Close = 172.289993 },
new { Date = "2018-11-26", Close = 178.580002 },
new { Date = "2018-12-03", Close = 168.490005 },
new { Date = "2018-12-10", Close = 165.479996 },
new { Date = "2018-12-17", Close = 150.729996 },
new { Date = "2018-12-24", Close = 156.229996 },
new { Date = "2018-12-31", Close = 148.259995 },
new { Date = "2019-01-07", Close = 152.289993 },
new { Date = "2019-01-14", Close = 156.820007 },
new { Date = "2019-01-21", Close = 157.759995 },
new { Date = "2019-01-28", Close = 166.520004 },
new { Date = "2019-02-04", Close = 170.410004 },
new { Date = "2019-02-11", Close = 170.419998 },
new { Date = "2019-02-18", Close = 172.970001 },
new { Date = "2019-02-25", Close = 174.970001 },
new { Date = "2019-03-04", Close = 172.910004 },
new { Date = "2019-03-11", Close = 186.119995 },
new { Date = "2019-03-18", Close = 191.050003 },
new { Date = "2019-03-25", Close = 189.949997 },
new { Date = "2019-04-01", Close = 197.0 },
new { Date = "2019-04-08", Close = 198.869995 },
new { Date = "2019-04-15", Close = 203.860001 },
new { Date = "2019-04-22", Close = 205.279999 }
};
}
}
#chart {
height: 440px;
}
.tooltip {
width: 300px;
}
You can set each annotation's type property to "text", "image", or "custom". Depending on the type, specify the text or image property. You can also add a description that will be displayed in a tooltip.
Annotations can be unattached or anchored to a chart element. In this demo, all annotations are anchored to series points via the argument and series properties. Refer to the annotations description for more information on how to position annotations.