Skip to content

Pie Chart's background doesnt change #443

@JustEndy

Description

@JustEndy

Description

Hi everyone!
I generated a Pie Chart, but I can't change the PaperBGColor of it anyhow.

Repro steps

  1. Using mypiechart.Show(), it shows it in HTML as transparent..
    but if I save it down with mypiechart.SavePNG(path) then background becomes white.

  2. I tried to Initialise a new Layout and add that to it, but same result.

           //I generate a Pie Chart in F#
            var pieChart = GG.PieStyled(values, labels);

            var legend = Legend.init();

            var layout = new Layout();
            layout.SetValue("legend", legend);
            layout.SetValue("title", "PiePie Chart");
            layout.SetValue("PaperBGColor", Plotly.NET.Color.fromARGB(0, 100, 255, 50));
            layout.SetValue("PlotBGColor", Plotly.NET.Color.fromARGB(0, 100, 255, 50));

            pieChart.WithLayout(layout);

            pieChart.SavePNG(name);

F# part of the code

namespace GraphGenerator

open Plotly.NET
open FSharp.Core
open Plotly.NET.ImageExport

module GG =
    [<CompiledName("PieStyled")>]
    let pieStyled (values, labels) =
        Chart.Pie(
            values = values,
            Labels = labels,
            SectionColors = [ Color.fromKeyword Aqua; Color.fromKeyword Salmon; Color.fromKeyword Tan ],
            SectionOutlineColor = Color.fromKeyword Black,
            SectionOutlineWidth = 2.,
            MultiText = labels,
            MultiTextPosition =
                [ StyleParam.TextPosition.Outside
                  StyleParam.TextPosition.Outside
                  StyleParam.TextPosition.Outside ],
            Rotation = 45.,
            MultiPull = [ 0.; 0.3; 0. ]
        )

Expected behavior

When I look at the saved down png image, I see a transparent Pie Chart.

Actual behavior

I see a Pie Chart with white background.

Related information

  • WIndows 11

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions