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.
Unfortunately, activation email could not send to your email. Please try again.

Candle, priceup, pricedown

Thread ID:

Created:

Updated:

Platform:

Replies:

77368 Oct 29,2008 05:44 AM Oct 30,2008 01:04 AM Windows Forms 1
loading
Tags: Chart
Administrator [Syncfusion]
Asked On October 29, 2008 05:44 AM

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 01:04 AM

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.

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.

;