|
<ChartComponent ref={chart} id="charts"
style={{ textAlign: "center" }}
primaryXAxis={{
valueType: "DateTime",
majorGridLines: { width: 0 },
zoomFactor: 0.2,
zoomPosition: 0.6,
crosshairTooltip: { enable: true }
}}
primaryYAxis={{
title: "Price",
minimum: 50,
maximum: 170,
interval: 30,
majorGridLines: { width: 1 },
lineStyle: { width: 0 }
}}
chartArea={{ border: { width: 0 } }}
tooltip={{
enable: true,
shared: true
}}
legendSettings={{ visible: false }}
crosshair={{ enable: true, lineType: "Vertical" }}
zoomSettings={{
enableSelectionZooming: true,
mode: "X",
enablePan: true
}}
title="AAPL 2012-2017"
>
<Inject
services={[
CandleSeries,
Category,
Tooltip,
DateTime,
Zoom,
Logarithmic,
Crosshair,
LineSeries,
RangeAreaSeries,
BollingerBands
]}
/>
<SeriesCollectionDirective>
<SeriesDirective
dataSource={chartData}
width={2}
xName="x"
yName="y"
low="low"
high="high"
close="close"
volume="volume"
open="open"
name="Apple Inc"
bearFillColor="#2ecd71"
bullFillColor="#e74c3d"
type="Candle"
animation={{ enable: false }}
/>
</SeriesCollectionDirective>
<IndicatorsDirective>
{showBollinger ?
<IndicatorDirective
type="BollingerBands"
field="Close"
seriesName="Apple Inc"
fill="#606eff"
period={14}
animation={{ enable: true }}
upperLine={{ color: "#ffb735", width: 1 }}
lowerLine={{ color: "#f2ec2f", width: 1 }}
/>
: <IndicatorDirective/>}
</IndicatorsDirective> </ChartComponent>// add your additional code snippet here |