We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Candle, priceup, pricedown

Thread ID:

Created:

Updated:

Platform:

Replies:

77368 Oct 29,2008 09:44 AM UTC Oct 30,2008 05:04 AM UTC WinForms 1
loading
Tags: Chart
Administrator [Syncfusion]
Asked On October 29, 2008 09:44 AM UTC

Hi,
I would like to see the code of this example:
https://www.syncfusion.com/products/chart/windows/features/Chart_Types/images/candlechart.png

It is the example "Candle Chart summarizing Stock Price for a day" that is in
https://www.syncfusion.com/products/chart/windows/features/Chart_Types/Financial_Charts.aspx

In this page it is written that "The body of the candle is often colored conditionally based on whether the open value is lower than the close value." but PriceUpColor and PriceDownColor only apply to chart types Kagi Chart, PointandFigure Chart, Renko Chart, Three Line Break Chart.

I want to create a candle serie with 2 colors: one color for the points such that the open price is bigger than the close price and one color for the other points


Manohari [Syncfusion]
Replied On October 30, 2008 05:04 AM UTC

Hi Mathias,

Thanks for your interest in Syncfusion products.

It is possible to set two different colors to the CandleSeries depending on the Open and close price, by handling the PrepareStyle event of that series.

Example:

series1.PrepareStyle += new ChartPrepareStyleInfoHandler(series1_PrepareStyle);

// Customize Candle series Style

void series1_PrepareStyle(object sender, ChartPrepareStyleInfoEventArgs args)
{
ChartSeries candleSeries = sender as ChartSeries;
if (candleSeries.Points[args.Index].YValues[2] > candleSeries.Points[args.Index].YValues[3])
{
args.Style.Interior = new BrushInfo(Color.SteelBlue);
}
else
{
args.Style.Interior = new BrushInfo(Color.Brown);
}


I have attached a sample that illustrates the same in this link below.

http://websamples.syncfusion.com/samples/Chart.Windows/F77368/Sample1.htm

Please let me know if this meets your requirement.

Regards,
Manohari.R


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;