Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. PieSeries Border Affects Legend
Qt 6.11 is out! See what's new in the release blog

PieSeries Border Affects Legend

Scheduled Pinned Locked Moved Unsolved Qt for Python
1 Posts 1 Posters 459 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    ilan_sw
    wrote on last edited by
    #1

    Hello, all!

    I created a PieSeries with a border, and as a result, the legend was reduced to a pixel in size. Is there a way to keep a border on the pie chart while keepiong the legend normal?

    Here's the code:

            ChartView {
                anchors.left: parent.left
                anchors.leftMargin: -30
                anchors.top: parent.top
                anchors.topMargin: -30//65
                backgroundColor: Styles.colorTransparent
                legend.labelColor: Styles.overviewLabelText
    
                width: 400//411
                height: 400//250
                legend.alignment: Qt.AlignRight
    
                PieSeries {
                    id: pieSeries
                    holeSize: 0.52
                    PieSlice { label: "0-35"; value: 5 ; color: Styles.age0_35_plot ; borderWidth: 5 ; borderColor : "#0c3564"}//; borderWidth: 0 ; borderColor : Styles.colorTransparent}
                    PieSlice { label: "35-45"; value: 15 ; color: Styles.age35_45_plot ; borderWidth: 5 ; borderColor : "#0c3564"}// ; borderWidth: 0 ; borderColor : Styles.colorTransparent}
                    PieSlice { label: "45-55"; value: 15 ; color: Styles.age45_55_plot ; borderWidth: 5 ; borderColor : "#0c3564"}// ; borderWidth: 0 ; borderColor : Styles.colorTransparent}
                    PieSlice { label: "55-65"; value: 15 ; color: Styles.age55_65_plot ; borderWidth: 5 ; borderColor : "#0c3564"}// ; borderWidth: 0 ; borderColor : Styles.colorTransparent}
                    PieSlice { label: "65-75"; value: 20 ; color: Styles.age65_75_plot ; borderWidth: 5 ; borderColor : "#0c3564"}// ; borderWidth: 0 ; borderColor : Styles.colorTransparent}
                    PieSlice { label: "+75"; value: 30 ; color: Styles.age_over75_plot ; borderWidth: 5 ; borderColor : "#0c3564"}// ; borderWidth: 0 ; borderColor : Styles.colorTransparent}
                }
            }
    

    Here's the outcome:
    9f829ff1-99cd-4533-aae1-09991d3fde98-image.png
    Thanks!

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved