A Microsoft Excel forum. ExcelBanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » ExcelBanter forum » Excel Newsgroups » Charts and Charting in Excel
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Shading between lines chart type.



 
 
Thread Tools Display Modes
  #1  
Old July 6th 09, 02:30 PM posted to microsoft.public.excel.charting
Kevin Burton
external usenet poster
 
Posts: 19
Default Shading between lines chart type.

Currently I have consturcted a chart that shows a line for each column. The
chart has a median column, upper 80% column, upper 95% column, lower 80%
column, and a lower 95% column. This works just fine using
Excel.

XlChartType.xlLine

Now I would like a line showing the median, with shading up to the upper 80%
and down to the lower 80% of one color, and shading from median to upper 95%
and down to lower 95% another color. Since the upper 95% is always greater
than upper 80% the shading showing the 95% levels would only show up between
the 80% and 95% levels. The xl3DStacked type almost gets me there but the 3D
takes up too much room and there seems to be multiple colors that I don't
want. xlLineStacked seems to change the display of the data in a way that I
am unfamiliar with. Maybe "stacked" assumes that the columns are deltas. I
don't know. Any suggestions for getting the chart look that I described?
Simply put I want to be able to shade between lines. Alternatively if I had
more control over the stock type of chart where I could specify multiple
levels of the bar variance rather than just a high low etc.

Thank you.

Ads
  #2  
Old July 6th 09, 04:39 PM posted to microsoft.public.excel.charting
Luke M
external usenet poster
 
Posts: 2,722
Default Shading between lines chart type.

Here's an article that talks about filling between lines. It might point you
in the right direction.
http://pubs.logicalexpressions.com/P...cle.asp?ID=590

Also, Jon Peltier has several examples of chart filling, that you might want
to look at:
http://peltiertech.com/Excel/Charts/BackgroundFill.html
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Kevin Burton" wrote:

> Currently I have consturcted a chart that shows a line for each column. The
> chart has a median column, upper 80% column, upper 95% column, lower 80%
> column, and a lower 95% column. This works just fine using
> Excel.
>
> XlChartType.xlLine
>
> Now I would like a line showing the median, with shading up to the upper 80%
> and down to the lower 80% of one color, and shading from median to upper 95%
> and down to lower 95% another color. Since the upper 95% is always greater
> than upper 80% the shading showing the 95% levels would only show up between
> the 80% and 95% levels. The xl3DStacked type almost gets me there but the 3D
> takes up too much room and there seems to be multiple colors that I don't
> want. xlLineStacked seems to change the display of the data in a way that I
> am unfamiliar with. Maybe "stacked" assumes that the columns are deltas. I
> don't know. Any suggestions for getting the chart look that I described?
> Simply put I want to be able to shade between lines. Alternatively if I had
> more control over the stock type of chart where I could specify multiple
> levels of the bar variance rather than just a high low etc.
>
> Thank you.
>

  #3  
Old July 6th 09, 06:37 PM posted to microsoft.public.excel.charting
Kevin Burton
external usenet poster
 
Posts: 19
Default Shading between lines chart type.

Maybe this isn't the right forum. I originally went to the VSTO forum but
they directed me here.

But I am having a hard time translating the Excel instructions into code. I
have the code:

try
{
ws.ListObjects.Add(Excel.XlListObjectSourceType.xl SrcRange,

ws.get_Range(((Excel.Range)ws.Cells[baseRow + 2, baseColumn + 1]),
((Excel.Range)ws.Cells[baseRow + projectedSalesList.Count + 2, baseColumn +
6])),
wb.missing,
Excel.XlYesNoGuess.xlYes,
wb.missing).Name = tableName;
if (!string.IsNullOrEmpty(tableFormat))
{
ws.ListObjects[tableName].TableStyle = tableFormat;
}
else
{
ws.ListObjects[tableName].TableStyle = "TableStyleLight1";
}
}
catch (Exception ex)
{
Debug.WriteLine(ex.ToString());
}
// Try to remove the previous chart
const string chartName = "ProjectedSalesDetailChart";
try
{
Excel.ChartObject chartObject = ws.ChartObjects(chartName)
as Excel.ChartObject;
if (chartObject != null)
{
chartObject.Delete();
}
}
catch (Exception)
{
// Eat the exception
// The chart probably doesn't exist
}
try
{
Excel.Shape shape =
ws.Shapes.AddChart(Excel.XlChartType.xlLine, wb.missing, wb.missing,
wb.missing, wb.missing);
shape.Name = chartName;
Excel.Chart chart = shape.Chart;
if (chart != null)
{

chart.SetSourceData(ws.ListObjects.get_Item(tableN ame).Range, wb.missing);
((Excel.Axis)chart.Axes(Excel.XlAxisType.xlCategor y,
Excel.XlAxisGroup.xlPrimary)).TickLabelPosition =
Excel.XlTickLabelPosition.xlTickLabelPositionHigh;
chart.HasTitle = true;
chart.ChartTitle.Text = heading;
chart.ChartArea.Width = chart.ChartArea.Width * 3;
chart.ChartArea.Height = chart.ChartArea.Height * 3;
chart.ApplyLayout(3, wb.missing);
}
}
catch (Exception ex)
{
Debug.WriteLine(ex.ToString());
}

So if I follow the instructions right I want to create a combination chart.
Which one of the steps above defines a series and a type? It seems that I
want to create a normal line series and on the same chart I want to create an
area series on the delta on the same chart. Let me get that far. Thank you.

Kevin

"Luke M" wrote:

> Here's an article that talks about filling between lines. It might point you
> in the right direction.
> http://pubs.logicalexpressions.com/P...cle.asp?ID=590
>
> Also, Jon Peltier has several examples of chart filling, that you might want
> to look at:
> http://peltiertech.com/Excel/Charts/BackgroundFill.html
> --
> Best Regards,
>
> Luke M
> *Remember to click "yes" if this post helped you!*
>
>
> "Kevin Burton" wrote:
>
> > Currently I have consturcted a chart that shows a line for each column. The
> > chart has a median column, upper 80% column, upper 95% column, lower 80%
> > column, and a lower 95% column. This works just fine using
> > Excel.
> >
> > XlChartType.xlLine
> >
> > Now I would like a line showing the median, with shading up to the upper 80%
> > and down to the lower 80% of one color, and shading from median to upper 95%
> > and down to lower 95% another color. Since the upper 95% is always greater
> > than upper 80% the shading showing the 95% levels would only show up between
> > the 80% and 95% levels. The xl3DStacked type almost gets me there but the 3D
> > takes up too much room and there seems to be multiple colors that I don't
> > want. xlLineStacked seems to change the display of the data in a way that I
> > am unfamiliar with. Maybe "stacked" assumes that the columns are deltas. I
> > don't know. Any suggestions for getting the chart look that I described?
> > Simply put I want to be able to shade between lines. Alternatively if I had
> > more control over the stock type of chart where I could specify multiple
> > levels of the bar variance rather than just a high low etc.
> >
> > Thank you.
> >

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Shading Between the Lines Fodor Excel Discussion (Misc queries) 1 December 6th 07 11:19 AM
Shading between two lines [email protected][_2_] Charts and Charting in Excel 1 September 11th 07 09:57 AM
Shading between two lines on a chart [email protected][_2_] Excel Discussion (Misc queries) 0 September 10th 07 07:17 PM
Shading a portion of the space between two lines [email protected] Charts and Charting in Excel 3 March 22nd 07 07:28 PM
Adding a line Chart Type to a stacked-clustered Chart Type Debbie Charts and Charting in Excel 2 January 5th 05 11:25 PM


All times are GMT +1. The time now is 06:22 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright 2004-2014 ExcelBanter.
The comments are property of their posters.