Re: OWC Chart: How to combine bar and line graf programatically?

From: Hans Riis (hri_at_bang-olufsen.dk)
Date: 05/05/04


Date: 5 May 2004 00:38:53 -0700

Hi, I'm sorry for the confusion. I changed the title of my response
without knowing it would start a new thread. The original question
was:

I'm trying to create a bar chart with one series of data and
another series of data represented as a line.
I get my data from MS SQL.
I create the chart in Frontpage and add dropdown menus with JavaScript
calls
to control the chart component for people with little IT
understanding.

For this first chart I'm looking for a way to combine bars and lines
using the same scale (in another chart I'll need to have separate
axes). I Haven't gotten as far as the combo part yet.

I hope somebody can help me out!

This bit of JavaScript code works for just changing one measure on the
y-axis:

 function Sel_Field()
 {
 c=ChartSpace1.Constants;
 ChartSpace1.PlotAllAggregates = 1;
 ChartSpace1.HasPlotDetails = true;
 ChartSpace1.PlotAllAggregates = c.chPlotAggregatesSeries;

 ChartSpace1.SetData(c.chDimValues, c.chDataBound, "");
 ChartSpace1.SetData(c.chDimValues, c.chDataBound, "BarVar");
 }

This doesn't work as a replacement of the last line above:
 ChartSpace1.SetData(c.chDimValues, c.chDataBound,
Array("BarVar","LineVar"));

I also tried VBScript but that didn't help much:

<SCRIPT language=VBScript
 set c=ChartSpace1.Constants
 ChartSpace1.PlotAllAggregates = 1;
 ChartSpace1.HasPlotDetails = true;
 ChartSpace1.PlotAllAggregates = c.chPlotAggregatesSeries

 ChartSpace1.SetData c.chDimValues, c.chDataBound, ""
 ChartSpace1.SetData c.chDimValues, c.chDataBound,
Array("BarVar","LineVar")
</SCRIPT

Thanks in advance, Hans Riis (Denmark)



Relevant Pages

  • Re: How can I combine a stacked bar chart with stacked colum chart
    ... The range L1:P241 is plotted in a stacked column chart in Stephen's example, ... or in a stacked bar chart in yours. ... >> Jon Peltier, Microsoft Excel MVP ... >> Peltier Technical Services ...
    (microsoft.public.excel.charting)
  • Re: How can I combine a stacked bar chart with stacked colum chart
    ... > or in a stacked bar chart in yours. ... > Jon Peltier, Microsoft Excel MVP ... >>> Peltier Technical Services ...
    (microsoft.public.excel.charting)
  • RE: sort bar chart in excel
    ... D2 as a single cell array (do so by pressing Control-Shift-Enter at the same ... items that you needed to chart, chnage the 10 in the formulas to 20. ... Base your bar chart on the second range of data. ...
    (microsoft.public.excel.charting)
  • HELP PLEASE modifying chart properties at runtime
    ... We first would like to change the height of our bar chart based on the ... Dim report1 As New CrystalReport9a ... Dim crxSubReport As craxdrt.Report ...
    (microsoft.public.vb.crystal)
  • RE: sort bar chart in excel
    ... D2 as a single cell array (do so by pressing Control-Shift-Enter at the same ... items that you needed to chart, chnage the 10 in the formulas to 20. ... Base your bar chart on the second range of data. ...
    (microsoft.public.excel.charting)