Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Forums

OverviewFelgo 2 Support (Qt 5) › Adding "°C" in the labelFormat (ValueAxis, BarSeries)

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #24230

    Florian

    Hello,

     

    I’m trying to add the degree character (°) in the y axis label of my chart.

    But it’s not working properly, I got the replacement character :

     

    I tried (inside the ValueAxis) :

    labelFormat: "%d°c"

    and :

    labelFormat: "%d\xB0C"

     

    Work good without the ‘°’.

    I searched a bit and haven’t found any solutions. So if anyone got a solution.

     

    Thank you.

    #24231

    Alex
    Felgo Team

    Hi Florian,

    please post a minimal runnable example that shows the issue. That will make it much quicker to investigate and provide you with a solution.

    Best,
    Alex

    #24233

    Florian

    Hi,

     

    I made a runnable sample :

    import QtQuick 2.5
    import Felgo 3.0
    import QtCharts 2.3
    
    App {
      Page {
        ChartView {
          height: dp(400)
    
          anchors.right: parent.right
          anchors.left: parent.left
          
          antialiasing: true
          legend.visible: false
    
          BarSeries {
            axisX: BarCategoryAxis {
                categories: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"]
                gridVisible: false
    
                labelsFont.family: "Roboto"
                labelsFont.weight: Font.DemiBold
                labelsColor: "#666B6E"
            }
            axisYRight: ValueAxis {
                labelFormat: "%d\xB0C"
                tickInterval: 1
            }
    
            BarSet {
                values: [25, 20, 30, 45, 50, 2, 15]
                color: "#0067BE"
            }
          }
        }
      }
    }

     

    The problem is the y axis label.

     

    Thanks.

    #24235

    Alex
    Felgo Team

    Hi Florian,

    you can use html entities in the label text, so in your case “°”

    Best,
    Alex

    #24239

    Florian

    Hi, that’s great, it works well.

     

    Thanks for your quick reply. Felgo is great 😀

Viewing 5 posts - 1 through 5 (of 5 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded