Now open any HTML file and add the following code. First we need to add a reference to Visifire2.js file inside the Head section of the HTML file.
<head runat="server">
<script type="text/javascript" src="Visifire2.js"></script>
</head>
Then inside the body, create different Chart XAML's inside a Script tag.
<script type="text/javascript">
var chartXaml1 = '<vc:Chart xmlns:vc="clr-namespace:Visifire.Charts;assembly=SLVisifire.Charts" Width="500" Height="300" Theme="Theme1">'
+ ' <vc:Chart.Titles>'
+ ' <vc:Title Text="Visifire Chart 1"/>'
+ ' </vc:Chart.Titles>'
+ ' <vc:Chart.Series>'
+ ' <vc
ataSeries RenderAs="Column">'
+ ' <vc
ataSeries.DataPoints>'
+ ' <vc
ataPoint AxisXLabel="Jan" YValue="35"/>'
+ ' <vc
ataPoint AxisXLabel="Feb" YValue="32"/>'
+ ' <vc
ataPoint AxisXLabel="Mar" YValue="27"/>'
+ ' <vc
ataPoint AxisXLabel="Apr" YValue="17"/>'
+ ' <vc
ataPoint AxisXLabel="May" YValue="16"/>'
+ ' </vc
ataSeries.DataPoints>'
+ ' </vc
ataSeries>'
+ ' </vc:Chart.Series>'
+ ' </vc:Chart>';
var chartXaml2 = '<vc:Chart xmlns:vc="clr-namespace:Visifire.Charts;assembly=SLVisifire.Charts" Width="500" Height="300" Theme="Theme1">'
+ ' <vc:Chart.Titles>'
+ ' <vc:Title Text="Visifire Chart 2"/>'
+ ' </vc:Chart.Titles>'
+ ' <vc:Chart.Series>'
+ ' <vc
ataSeries RenderAs="Column">'
+ ' <vc
ataSeries.DataPoints>'
+ ' <vc
ataPoint AxisXLabel="Jan" YValue="25"/>'
+ ' <vc
ataPoint AxisXLabel="Feb" YValue="42"/>'
+ ' <vc
ataPoint AxisXLabel="Mar" YValue="18"/>'
+ ' <vc
ataPoint AxisXLabel="Apr" YValue="37"/>'
+ ' <vc
ataPoint AxisXLabel="May" YValue="40"/>'
+ ' </vc
ataSeries.DataPoints>'
+ ' </vc
ataSeries>'
+ ' </vc:Chart.Series>'
+ ' </vc:Chart>';
var chartXaml3 = '<vc:Chart xmlns:vc="clr-namespace:Visifire.Charts;assembly=SLVisifire.Charts" Width="500" Height="300" Theme="Theme1">'
+ ' <vc:Chart.Titles>'
+ ' <vc:Title Text="Visifire Chart 3"/>'
+ ' </vc:Chart.Titles>'
+ ' <vc:Chart.Series>'
+ ' <vc
ataSeries RenderAs="Column">'
+ ' <vc
ataSeries.DataPoints>'
+ ' <vc
ataPoint AxisXLabel="Jan" YValue="33"/>'
+ ' <vc
ataPoint AxisXLabel="Feb" YValue="12"/>'
+ ' <vc
ataPoint AxisXLabel="Mar" YValue="28"/>'
+ ' <vc
ataPoint AxisXLabel="Apr" YValue="57"/>'
+ ' <vc
ataPoint AxisXLabel="May" YValue="30"/>'
+ ' </vc
ataSeries.DataPoints>'
+ ' </vc
ataSeries>'
+ ' </vc:Chart.Series>'
+ ' </vc:Chart>';
</script>
Then inside the body, create multiple div elements and add the JavaScript code which renders the Chart inside each div element.
<div id="VisifireChart0">
<script type="text/javascript">
// Create Visifire object
var vChart1 = new Visifire2('SL.Visifire.Charts.xap', "MyChart1", 500, 300);
// Set Chart XAML as string
vChart1.setDataXml(chartXaml1);
// Render chart
vChart1.render("VisifireChart0");
</script>
</div>
<div id="VisifireChart1">
<script type="text/javascript">
// Create Visifire object
var vChart2 = new Visifire2('SL.Visifire.Charts.xap', "MyChart2", 500, 300);
// Set Chart XAML as string
vChart2.setDataXml(chartXaml2);
// Render chart
vChart2.render("VisifireChart1");
</script>
</div>
<div id="VisifireChart2">
<script type="text/javascript">
// Create Visifire object
var vChart3 = new Visifire2('SL.Visifire.Charts.xap', "MyChart3", 500, 300);
// Set Chart XAML as string
vChart3.setDataXml(chartXaml3);
// Render chart
vChart3.render("VisifireChart2");
</script>
</div>
smorgs8 wrote:
How do I print multiple charts on one page?
16-Sep-07
I have got all of my graphs in different sheets, but I cannot figure out how to
print 2 per page. Is there any possible way to do this?!
Previous Posts In This Thread:
How do I print multiple charts on one page?
I have got all of my graphs in different sheets, but I cannot figure out how to
print 2 per page. Is there any possible way to do this?!
Embed the charts onto a single worksheet.
Embed the charts onto a single worksheet. If the charts are on separate
chart sheets (no underlying cells), right click the chart and select
Location, and choose the target sheet from the As Object In dropdown. If the
charts are embedded on different worksheets, copy each and paste it onto a
single worksheet. Finally, print out the worksheet with all of the charts.
- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. -
http://PeltierTech.com
_______
Submitted via EggHeadCafe - Software Developer Portal of Choice
Secure Session State Transfer: ASP to ASP.NET
http://www.eggheadcafe.com/tutorial...e-1ef18cbb92e1/secure-session-state-tran.aspx