Coder Social home page Coder Social logo

Barchart was ignored about z3c.rml HOT 6 CLOSED

zopefoundation avatar zopefoundation commented on June 10, 2024
Barchart was ignored

from z3c.rml.

Comments (6)

rapto avatar rapto commented on June 10, 2024 1

I believe it should be inside an illustration, but I have not been able to produce a simple working example.

from z3c.rml.

Abdur-rahmaanJ avatar Abdur-rahmaanJ commented on June 10, 2024

@strichter any idea about this one?

from z3c.rml.

strichter avatar strichter commented on June 10, 2024

@Abdur-rahmaanJ All the charts are only available in drawings as they draw directly on the canvas. So <illustration> is a way to add a drawing in the story. That's what I do.

I thought I had added a mode that will raise an error when a tag is in a place where it is not supposed to be. But I guess it is not exposed in the CLI. Ah yes, z3c.rml.directive.ABORT_ON_INVALID_DIRECTIVE.

from z3c.rml.

Abdur-rahmaanJ avatar Abdur-rahmaanJ commented on June 10, 2024

Ok let me try! Did not understand @rapto's comment!

from z3c.rml.

Abdur-rahmaanJ avatar Abdur-rahmaanJ commented on June 10, 2024

@strichter this outputs a blank page:

<!DOCTYPE document SYSTEM "rml.dtd">
<document filename="01.pdf">
 <template>
 <!--this section contains elements of the document -->
 <!--which are FIXED into position. -->
 <pageTemplate id="main">
 <frame id="first" x1="100" y1="400" width="150" height="200"/>
 </pageTemplate>
 </template>
 <stylesheet>
 <!--this section contains the STYLE information for -->
 <!--the document, but there isn't any yet. The tags still -->
 <!--have to be present, however, or the document won't compile.-->
 </stylesheet>
 <story>
<illustration height="5cm" width="5cm">
 <barChart dx="2in" dy="7in" dwidth="6in" dheight="4in" x="0" y="0" width="5in"
 height="3in" barSpacing="7" groupSpacing="15">
 <bars>
 <bar fillColor="blue" strokeColor="red" strokeWidth="0.5"/>
 <bar fillColor="yellow" strokeColor="green" strokeWidth="1"/>
 </bars>
 <categoryAxis strokeColor="black" strokeWidth="1">
 <labels fontName="Helvetica" fontSize="20"/>
 <categoryNames>
 <name>Category 1</name>
 <name>Category 2</name>
 <name>Category 3</name>
 <name>Category 4</name>
 </categoryNames>
 </categoryAxis>
 <valueAxis valueMin="0" valueMax="150" valueStep="30" visibleTicks="true"
 visibleLabels="true" forceZero="true">
 <labels fontName="Helvetica"/>
 </valueAxis>
 <data>
 <series>100 110 120 130</series>
 <series> 70 80 85 90</series>
 </data>
</barChart>
</illustration>
 </story>
</document>

from z3c.rml.

regebro avatar regebro commented on June 10, 2024

Here's a version that works for future reference:

<!DOCTYPE document SYSTEM "rml.dtd">
<document filename="01.pdf">
 <template>
 <!--this section contains elements of the document -->
 <!--which are FIXED into position. -->
 <pageTemplate id="main">
 <frame id="first" x1="100" y1="400" width="150" height="200"/>
 </pageTemplate>
 </template>
 <stylesheet>
 <!--this section contains the STYLE information for -->
 <!--the document, but there isn't any yet. The tags still -->
 <!--have to be present, however, or the document won't compile.-->
 </stylesheet>
  <pageDrawing>

    <setFont name="Helvetica-Bold" size="16" />
    <drawCenteredString x="4.1in" y="11in">
      Bar Chart Demo
    </drawCenteredString>

 <barChart dx="2in" dy="7in" dwidth="6in" dheight="4in" x="0" y="0" width="5in"
 height="3in" barSpacing="7" groupSpacing="15">
 <bars>
 <bar fillColor="blue" strokeColor="red" strokeWidth="0.5"/>
 <bar fillColor="yellow" strokeColor="green" strokeWidth="1"/>
 </bars>
 <categoryAxis strokeColor="black" strokeWidth="1">
 <labels fontName="Helvetica" fontSize="20"/>
 <categoryNames>
 <name>Category 1</name>
 <name>Category 2</name>
 <name>Category 3</name>
 <name>Category 4</name>
 </categoryNames>
 </categoryAxis>
 <valueAxis valueMin="0" valueMax="150" valueStep="30" visibleTicks="true"
 visibleLabels="true" forceZero="true">
 <labels fontName="Helvetica"/>
 </valueAxis>
 <data>
 <series>100 110 120 130</series>
 <series> 70 80 85 90</series>
 </data>
</barChart>
</pageDrawing>

</document>

from z3c.rml.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.