> I am trying to draw a barchart using batik to view .It previously worked 
> using adobe svg viewer but I have been trying to convert the code so that it 
> Is batik compatible.
> 
> I have changed 
> 
> 1) createElementNS(null,      --to--          
> createElementNS("http://www.w3.org/2000/svg";,
> 2) .setAttribute                      --to--          .setAttributeNS
> 3) .getAttribute                      --to--          .getAttributeNS
> 
> 
> There is a LoadChartDataFromTable function that has a loop like the following 
> :-
>               
> for(i<sortedvals.length-1;i>=0;i--) {         
>       j = j + 1;
>       if(sortedvals[i]!=null) {       
>       var keys=sortedvals[i].split("|")               
>       for(ky =0;ky< keys.length;ky++) {       
>               this.AddChartValue(i,keys[ky],false); 
>       }                               
> }
> 
> The AddChartValue function is called multiple times until key.length = the 
> maximum number of bars needed in the bar chart, below is a sample of the 
> function
> 
> 
> Chart.prototype.AddChartValue=function(Value, Name, Repress)
>         {
>         var Start = new Date().getTime(); 
>           Value = Value * 1
>           if ((Value <= 0) || (isNaN(Value)))
>             {
>               return;
>             }
>           Color = ColorArray[this.CurrentColor]
>           Name=Name.replace("'","ยด")
>           if((Name==" ")||(Name=="")||(Name==null)) {
>               Name="<blank>"
>           }
>           
>           this.Captions[this.Captions.length]=Name
>           this.CurrentColor++
>           if (this.CurrentColor >= ColorArray.length) this.CurrentColor = 0
>           if (!(this.Removed))
>             {
>               this.Grandparent1.removeChild(this.ParentGroup1)
>               this.Grandparent2.removeChild(this.ParentGroup2)
>               this.Grandparent3.removeChild(this.ParentGroup3)
>               this.Grandparent4.removeChild(this.ParentGroup4)
>             }
>           this.Values[this.Values.length] = Value * 1
>           this.Names[this.Names.length] = 
> this.SVGDocument.createElementNS(null,"text")
>         // Bar Chart  
>           this.BarElements[this.BarElements.length] = 
> this.SVGDocument.createElementNS("http://www.w3.org/2000/svg","path";)        
>           this.BarElements[this.BarElements.length - 
> 1].setAttributeNS(null,"fill", Color)      
>           this.BarElements[this.BarElements.length - 
> 1].setAttributeNS(null,"stroke", "black")  
>           this.BarElements[this.BarElements.length - 
> 1].setAttributeNS(null,"opacity", "0.7")   
>           this.BarElements[this.BarElements.length - 
> 1].setAttributeNS(null,"id", "bar"+ Color)   
>           this.BarElements[this.BarElements.length - 
> 1].setAttributeNS(null,"cursor","pointer")
>           this.BarElements[this.BarElements.length - 
> 1].setAttributeNS(null,"onclick","ChartContext["+this.getChartIndex()+"].doLegendClick("
>  + (this.BarTexts.length - 1) + ");")
>           this.SetUpObjectToolTip(this.BarElements[this.BarElements.length - 
> 1], Name + " - " + Value)
>           
> this.ParentGroup2.appendChild(this.BarElements[this.BarElements.length - 1])
> 
>           this.BarTexts[this.BarTexts.length] = 
> this.SVGDocument.createElementNS("http://www.w3.org/2000/svg","text";)
>           this.BarTexts[this.BarTexts.length - 
> 1].setAttributeNS(null,"style", 
> "text-anchor:middle;font-weight:bold;font-size:13;visibility:hidden")
>           this.BarTexts[this.BarTexts.length - 
> 1].appendChild(this.SVGDocument.createTextNode(Value ))
>           this.ParentGroup2.appendChild(this.BarTexts[this.BarTexts.length - 
> 1])
> 
>           this.Names[this.Names.length - 
> 1].appendChild(this.SVGDocument.createTextNode(Name + ""))
>           this.Names[this.Names.length - 1].setAttributeNS(null,"transform", 
> "rotate(45)")
>           this.Names[this.Names.length - 
> 1].setAttributeNS(null,"text-anchor", "middle")      
>           this.Names[this.Names.length - 
> 1].setAttributeNS(null,"font-weight", "bold")  
>           this.Names[this.Names.length - 1].setAttributeNS(> 
> null,"font-size", "13")   
>           this.Names[this.Names.length - 
> 1].setAttributeNS(null,"cursor","pointer");
> 
>           
> this.SVGDocument.getElementById("labels").appendChild(this.Names[this.Names.length
>  - 1])
>           
>           if (Repress)
>             this.Removed = true
>           else
>             {
>               this.Removed = false
>               this.Grandparent1.appendChild(this.ParentGroup1)
>               this.Grandparent2.appendChild(this.ParentGroup2)
>               this.Grandparent3.appendChild(this.ParentGroup3)
>               this.Grandparent4.appendChild(this.ParentGroup4)
>             }
> }
> 
> 
> The problem I am experiencing is that the first bar in the barchart is being 
> drawn and the rest appear to be invisible. However the cursor attribute 
> attached to the BarElements above shows me that the bars are where they 
> should be because my mouse cursor changes to a pointer when hovering above 
> them. But the bars are not showing their fill property or stroke or anything.
> 
> What could be the problem?
> 
> I am using java platform 6 version 1.6.0 on windows XP, with IE 7 
> 
> Thanks
> 
> Manny
> 
> 
> 
> 
> 
> 
>
 
--------------------------------------------------------------------------------
Telelogic Lifecycle Solutions:
Helping You Define, Design & Deliver Advanced Systems & Software
Learn More at www.telelogic.com

 
Mandeep Jootle
Senior Web Developer
Telelogic UK Ltd.
Parkway 1
Broxell Close,
Warwick
CV34 5QF, United Kingdom

Phone: +44 (1926) 474 120
Fax: +44 (1926) 474 101
Mobile phone: 


[EMAIL PROTECTED]
http://www.telelogic.com

Telelogic - Requirements-Driven Innovation!
-------------------------------------------------------------




 
The information contained in this e-mail, including any attachment or 
enclosure, is intended only for the person or entity to which it is addressed 
and may contain confidential material. Any unauthorized use, review, 
retransmissions, dissemination, copying or other use of this information by 
persons or entities other than the intended recipient is prohibited.


[Non-text portions of this message have been removed]



-----
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my 
membership"
---- 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/svg-developers/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/svg-developers/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Reply via email to