6 Replies Latest reply on Nov 26, 2006 3:23 PM by MikerRoo

    Help With Setting Font Sizes in CFCHART

    Gary1 Level 1
      We are just upgrading from CF5 to CF7, and am currently converting many of our CF5 CHART TEMPLATES to use CF7's new CFGRAPH and related tags. Am having trouble controlling font size in various parts of chart.

      Regarding font sizes, can you set the size of the X-Axis labels to one size, the X and Y Axis Titles to another, and the Chart Title to another? It seems you only get to control the font size once for the entire chart??? Is this correct?

      Example: Have BAR and LINE charts with many data points, so need the X-Axis labels to be small enough to fit across the bottom. BY THE WAY, IS THERE A WAY TO GET THESE LABELS TO DISPLAY VERTICALLY, VS. HORIZONTALLY, OR EVEN AT AN ANGLE? OR DO THEY ALWAYS DISPLAY HORIZONTALLY?

      But would like the X and Y Axis Titles (the description of what the X and Y axis is charting) to be a larger font. Finally, would like the chart title (at the top of the chart) to be a different, larger font. IS ALL THIS POSSIBLE?

      The only option I see for setting font size is with the <CFCHART fontsize="integer"> option. But this seems to control the font size of EVERYTHING on the chart. The chart tags that control X and Y Axis (xAxisTitle and yAxixTitle) don't seem to offer font size options. And the X and YAxisType tags don't seem to offer the ability (in the case of the X Axis) to display the labels at an angle or vertically vs. the default horizontally.

      If all this is true, can the font sizes for these items be controlled via CSS or any other way? Thanks for any help/advice.

        • 1. Re: Help With Setting Font Sizes in CFCHART
          MikerRoo Level 1
          You can control all of those fonts using XML styles.
          Create the styles using WebCharts3D.
          See http://livedocs.macromedia.com/coldfusion/7/htmldocs/00001431.htm to get started.

          • 2. Re: Help With Setting Font Sizes in CFCHART
            Gary1 Level 1
            Thanks for the tip. So the answer to my first question is that, without modifying these XML styles, you only get ONE FONE SIZE attribute for EVERYTHING in your chart, using the attributes that come with CFCHART and CFCHARTSERIES, correct?

            Second, I looked at the HTML DOCs article you recommended (printed it out), and all the attributes seem to be the same ones available in CFCHART. In other words, SAME PROBLEM. It doesn't appear to have attributes that let you control the font size for different elements of your chart.

            As mentioned, what I want to do is control the FONT SIZE of THREE different chart elements: X-Axis Labels, X and Y-Axis Titles, and Chart Title. I don't see how I can do that using either method.

            I also would like to display the X-Axis labels vertically, vs. horizontally, so more will "fit" across the bottom when charting a lot of data in LINE and BAR charts. I don't see how this can be done using either (CFCHART or XML adjustments).

            Maybe I just need to experiment with it, and see what can be done. But I appreciate the info, and the time you took to respond. Thank you.

            • 3. Re: Help With Setting Font Sizes in CFCHART
              MikerRoo Level 1
              1) Yes, without XML, you only have one font size control.

              2) That chart shows how the tag attributes OVERLAP some of the xml controls. There are many more xml controls that have no matching tag attribute (a design flaw in my opinion).
              Run the WebCharts3d program to see what is actually available.

              3) Everything you have stated here is easily possible using XML styles. Run the WebCharts3d program and see.
              • 4. Re: Help With Setting Font Sizes in CFCHART
                Gary1 Level 1
                Thanks for the tip, and for taking the time to reply. I'll take your word for it. I've never heard of, or used WebCharts3D, as I'm just converting from CF5 to CF7, and I know there's a lot to learn. I'll check it out, and thanks again. It's good to know that the font sizes in various sections of your charts CAN be controlled.

                • 5. Re: Help With Setting Font Sizes in CFCHART
                  Gary1 Level 1
                  Thanks to your advice, was able to use WebCharts3D to control "most" attributes in my line chart (using CF 7.0.2, Win2K, SQL Server, IE7, Firefox 2). Am creating my own chart style XML files, and calling them in the CFCHART tag.

                  For example, can control appearance of X and Y axis labels and titles (e.g., horizontal, vertical, spacing, etc.). So far, so good.

                  BUT I STILL HAVE NO CONTROL OVER THE FONT SIZES OF VARIOUS ITEMS IN MY CHART. Even after removing the "font size" attribute from the <CFCHART> tag, EVERYTHING SHOWS UP IN THE SAME FONT SIZE.

                  For example, I need my chart's title to display in 24 point ARIAL, and would like the X and Y axis titles to display in 16 point ARIAL. But somehow, EVERYTHING (all text) is displayed in 12 point ARIAL when I execute the CF chart template.

                  What is strange, is that when working in WebCharts3D, the chart title ON THE SCREEN IS DISPLAYED IN THE LARGER FONT. It's just that it won't display in the larger font when running the CF chart template.

                  Is this the way WebCharts3D is supposed to work? Or should you be able to set different font sizes for different chart elements, using WebChart3D's XML styles? If so, is there some setting in WebCharts3D that allows you to do this, and somehow disables a "FIXED FONT SIZE" for all chart elements?

                  Thanks for any help, advice.
                  • 6. Re: Help With Setting Font Sizes in CFCHART
                    MikerRoo Level 1
                    Yeah, you're right.
                    I just ran a test and the font-size XML styles are not passed, by CFChart, to the chart engine!

                    Oh well, just one more of dozens of cfchart bugs.

                    I've said it before: cfchart is useless for most real-life plots.

                    File a bug report at: http://www.macromedia.com/support/email/wishform/ .