Sign in to follow this  
aman0711

Styles not working for subCaption

Recommended Posts

I trying to edit the font of my subCaption, but somehow I am not able to produce the chart at all after the adding the following code at bottom of XML. Please tell me where am I going wrong.

 

 

 

I have attached the file

styles.txt

Share this post


Link to post
Share on other sites

The wrong attribute in the xml is:

color='#FF0000' 

Color attributes in FusionCharts are always hex code without the #.

Please try with

color='FF0000' 

attribute in the trendlines section.

Hope this works out for you.

Share this post


Link to post
Share on other sites

Hi Srividya,

 

I took out the '#' and it still didnt work. I dont think '#' is causing any problem here. My chart was working fine with it, until I added the styles tag. Now I am just getting a blank page.

 

Attached is the complete code.

 

I want to make my subCaption little smaller in size with a red color.

chart_code_new.txt

Share this post


Link to post
Share on other sites

Hi Srividya,

I am sorry, I added the exact code that you gave me and still nothing came up on my jsp page. This is only occuring when I am adding the styles code. Chart is renedering fine without that code, but as soon as I am adding that code.. theres nothing getting displayed on the screen. I have attached both my jsp code and the HTML of blank page.

Please help me out with this :)

CHART HTML.txt

CODE.txt

Share this post


Link to post
Share on other sites

@ Srividya,

  I am using Fusion Charts V3, not the free copy.

@ Rahul,

I replaced '%' with '%25' in numberSuffix.

 Still as soon as I add the styles code. Chart disappears from the page with no error messages or anything like that.

Share this post


Link to post
Share on other sites

Hi,

Could you please let us know, why are you using out.print(strXml); in file CODE.txt?

Is that really important to display the XML string in between HTML moreover where you have not retained proper HTML structure?

Please  see the code below, I have just pasted here as it was in the file.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%@ page contentType="text/html; charset=iso-8859-1" language="java"

 import="java.sql.*" errorPage=""%>

<%@include file="../Includes/FusionCharts.jsp"%>

<script language="JavaScript" src="../FusionCharts/FusionCharts.js"></script>

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">

<meta name="GENERATOR" content="Rational Application Developer">

<%

 Connection conn = null;

 Class.forName("oracle.jdbc.driver.OracleDriver");

 conn = DriverManager.getConnection("jdbc:oracle:thin:@","USER","PASS");

%>

<%-- Fusion Chart XML creation using dataXML method --%>

<%

String strXml="";

String strQuery1="", strQuery2="", strQuery3="", strQuery4="", cat="", dataset1="", dataset2="", dataset3="", dataset4="";

strXml="<chart imageSave='1' imageSaveURL='Path/FusionChartsSave.jsp' caption='Monthly SLA Compliance' subCaption='current month to date' xAxisName='' legendPosition='RIGHT' legendMarkerCircle ='1' lineThickness='1' numberSuffix='%' showBorder='1' divLineAlpha='10' divLineColor='CC3300' divLineIsDashed='0' labelStep='1' numDivLines='10' yAxisMaxValue='100' chartTopMargin='20' yAxisValuesPadding='7' showValues='0'  >";

try{

  Statement st1, st2, st3, st4;

  ResultSet rs1, rs2, rs3, rs4;

 strQuery1= "Select * from  VSLAND.APM_WEB_12MONTH_APPGRP_V WHERE APP_GROUP='EBILL' ORDER BY DECODE(UPPER(MONTH), 'JAN', 7, 'FEB', 8, 'MAR', 9, 'APR', 10, 'MAY', 11, 'JUN', 12, 'JUL', 1, 'AUG', 2, 'SEP', 3, 'OCT', 4, 'NOV', 5, 'DEC', 6)";

 strQuery2= "Select * from VSLAND.APM_WEB_12MONTH_APPGRP_V WHERE APP_GROUP='EDD' ORDER BY DECODE(UPPER(MONTH), 'JAN', 7, 'FEB', 8, 'MAR', 9, 'APR', 10, 'MAY', 11, 'JUN', 12, 'JUL', 1, 'AUG', 2, 'SEP', 3, 'OCT', 4, 'NOV', 5, 'DEC', 6)";

 strQuery3= "Select * from VSLAND.APM_WEB_12MONTH_APPGRP_V WHERE APP_GROUP='KANAC' ORDER BY DECODE(UPPER(MONTH), 'JAN', 7, 'FEB', 8, 'MAR', 9, 'APR', 10, 'MAY', 11, 'JUN', 12, 'JUL', 1, 'AUG', 2, 'SEP', 3, 'OCT', 4, 'NOV', 5, 'DEC', 6)";

 strQuery4= "Select * from VSLAND.APM_WEB_12MONTH_APPGRP_V WHERE APP_GROUP='QuickPay' ORDER BY DECODE(UPPER(MONTH), 'JAN', 7, 'FEB', 8, 'MAR', 9, 'APR', 10, 'MAY', 11, 'JUN', 12, 'JUL', 1, 'AUG', 2, 'SEP', 3, 'OCT', 4, 'NOV', 5, 'DEC', 6)";

 

 st1=conn.createStatement();

 rs1=st1.executeQuery(strQuery1);

 

 while(rs1.next()){

cat += "<category label='"+rs1.getString(2)+"'/>";

dataset1 +="<set value='"+rs1.getFloat(4)+"'/>";

 }

 

  rs1.close();

  st1.close();

 

  st2=conn.createStatement();

  rs2=st2.executeQuery(strQuery2);

  while(rs2.next()){

 // cat += "<category label='"+rs2.getString(2)+"'/>"  ;

dataset2 +="<set value='"+rs2.getFloat(4)+"'/>";

 }

 

  rs2.close();

  st2.close();

 

  st3=conn.createStatement();

  rs3=st3.executeQuery(strQuery3);

  while(rs3.next()){

 // cat += "<category label='"+rs3.getString(2)+"'/>"  ;

dataset3 +="<set value='"+rs3.getFloat(4)+"'/>";

 }

 

  rs3.close();

  st3.close();

 

 

  st4=conn.createStatement();

  rs4=st4.executeQuery(strQuery4);

  while(rs4.next()){

 // cat += "<category label='"+rs3.getString(2)+"'/>"  ;

dataset4 +="<set value='"+rs4.getFloat(4)+"'/>";

 }

 

  rs4.close();

  st4.close();

 

 

}catch (Exception e){}

 

 strXml += "<categories> "+cat+"</categories>";

 

 strXml += "<dataset seriesName='EBILL' color='F665AB' anchorBorderColor='F665AB' anchorBgColor='F665AB'> "+dataset1+" </dataset>";

 

 strXml += "<dataset seriesName='EDD' color='2B15F5' anchorBorderColor='2B15F5' anchorBgColor='2B15F5'> "+dataset2+" </dataset>";

 

 strXml += "<dataset seriesName='KANAC' color='15F5EA' anchorBorderColor='15F5EA' anchorBgColor='15F5EA'> "+dataset3+" </dataset>";

 

 strXml += "<dataset seriesName='QuickPay' color='040300' anchorBorderColor='040300' anchorBgColor='040300'> "+dataset4+" </dataset>";

 

 strXml += "<styles>";

 strXml += "<definition>";

 strXml += "<style name='subCaption1' type='Font' size='14' />";

 strXml += "</definition>";

 strXml += "<application>";

 strXml += "<apply toObject='subCaption' styles='subCaption1' /> ";

 strXml += "</application>";

 strXml += "</styles>";

 

 strXml += "</chart>";

 

 out.print(strXml);

String chartCode=createChart("../FusionCharts/MSLine.swf", "", strXml, "SLA", 745, 300, false, false);

%>

<%

conn.close();

%>

<%=chartCode%>

The use of out.print(strXml); is breaking the structure of HTML and you are not getting anything.

Please remove out.print(strXml); the from the code.

Edited by Guest

Share this post


Link to post
Share on other sites

Hi Rahul,

Thanks a ton. You solved the problem :)

But now it gave way to a new problem. Nothing is getting plotted on the chart. Instead the datapoints moved right at the top of chart..

  Attached is the screen shot

post-3394-128441570244_thumb.jpg

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this