4 Replies Latest reply on Jun 20, 2017 12:40 PM by fac586

    How to show series name in a Pie Chart (APEX 5.1)?

    MGA DBA

      I have to say I'm finding the charts in 5.1 a lot harder to work with than previous versions, so much that I'm looking to go back to 5.0. I'm a DBA, not a developer, and I'd rather not have to spend time learning JavaScript to get simple things to work.

       

      For example, I have a pie chart based on a simple table with 2 columns and 42 rows

       

      WARNINGS     CRITICALS

      2                     1

      4                     3

      6                     2

      etc

       

      The SQL:

       

      SELECT sum(WARNINGS) AS WARNING

      FROM issues

      union all

      SELECT sum(CRITICALS) AS CRITICAL

      FROM issues

       

      The first problem - the chart only shows 1 colour

       

      To get it to show 2 colours I have to separate the query into 2 series (or write / steal some javascript)

       

      SELECT sum(WARNINGS) AS WARNING

      FROM issues

       

      SELECT sum(CRITICALS) AS CRITICAL

      FROM issues

       

      But it doesn't show 'Warning' and 'Critical' in the legend, but the value:

       

      How do I get it to display the 'Warning' and 'Critical' in the legend?

       

      Thanks in advance.

        • 1. Re: How to show series name in a Pie Chart (APEX 5.1)?
          fac586

          MGA DBA wrote:

           

          I have to say I'm finding the charts in 5.1 a lot harder to work with than previous versions, so much that I'm looking to go back to 5.0. I'm a DBA, not a developer, and I'd rather not have to spend time learning JavaScript to get simple things to work.

           

          For example, I have a pie chart based on a simple table with 2 columns and 42 rows

           

          WARNINGS CRITICALS

          2 1

          4 3

          6 2

          etc

           

          The SQL:

           

          SELECT sum(WARNINGS) AS WARNING

          FROM issues

          union all

          SELECT sum(CRITICALS) AS CRITICAL

          FROM issues

           

          The first problem - the chart only shows 1 colour

           

          To get it to show 2 colours I have to separate the query into 2 series (or write / steal some javascript)

           

          SELECT sum(WARNINGS) AS WARNING

          FROM issues

           

          SELECT sum(CRITICALS) AS CRITICAL

          FROM issues

           

          But it doesn't show 'Warning' and 'Critical' in the legend, but the value:

           

          How do I get it to display the 'Warning' and 'Critical' in the legend?

          Review the examples in the Sample Charts packaged application.

           

          Include a label column in the source query and select it in the Label attribute in the Column Mapping section of the series property sheet:

           

          select
              'Warning' label
            , sum(warnings) val
          from
              issues
          union all
          select
              'Critical'
            , sum(criticals)
          from
              issues
          
          • 2. Re: How to show series name in a Pie Chart (APEX 5.1)?
            MGA DBA

            Thanks!

             

            Although with the one query it still only shows 1 colour, so I've had to split it up into 2 series.

            • 3. Re: How to show series name in a Pie Chart (APEX 5.1)?
              teedub

              Add a 3rd column to your sql like:

               

              ...

              , 'red' color

              ...

              union

              ...

              , '#007AFF'

              ...

               

              Then use this column (as &COLOR.) in Appearance > Color

               

              (This is also in the Sample Charts application; try bar charts, series defined colors.)

               

              I too am a DBA.  Jet is way easier and more flexible that previous chart incantations - and I have avoided javascript in Jet Charting so far. My one major (solvable) issue is the way that multi-series charts are handled. Read Series Name in JET Charts - Oracle Application Express (APEX)  (or other similar posts) because this IS frustrating until you realise what is happening.

               

              cheers

              ~t

              • 4. Re: How to show series name in a Pie Chart (APEX 5.1)?
                fac586

                MGA DBA wrote:

                 

                Although with the one query it still only shows 1 colour, so I've had to split it up into 2 series.

                Not reproducible from the information available. Suggest you demonstrate the problem using an example on apex.oracle.com.

                 

                What happens if you create a new chart page from scratch using the query above, with no customization other than setting the Label and Value column attributes?