-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Legend not showing up after setting LabelConfig #8
Comments
Hey @bwong199! Indeed this seems like an issue with the binding, will do a fix for this soon. In the meantime, you can use the following as a workaround: Instead of:
use this:
|
Hi @Jooseppi12 , Thanks for getting back. The legend now shows up but the font label doesn't seem to be changed. All I changed was that line ^^^, were you able to get it to work? Thanks! |
@bwong199 Using the following code: let bdColor = [|
"rgba(255, 99, 132, 1)"
"rgba(54, 162, 235, 1)"
"rgba(255, 206, 86, 1)"
"rgba(75, 192, 192, 1)"
"rgba(153, 102, 255, 1)"
"rgba(255, 159, 64, 1)"
|]
let options = Options()
let plugins = Plugin()
let legendConfig = LegendConfig()
let font = Font()
font.Size <- 30
font.Family <- "'Helvetica Neue'"
font.Style <- FontStyle.Italic
let labelConfig = LabelConfig()
labelConfig.Font <- font
labelConfig.Color <- Union1Of2 1
labelConfig.BoxHeight <- 200
labelConfig.BoxWidth <- 200
labelConfig.Padding <- 30
labelConfig.UsePointStyle <- true
legendConfig.Display <- true
legendConfig.Position <- PositionString.Top
legendConfig.Align <- AlignString.Center
legendConfig.FullSize <- true
legendConfig.MaxHeight <- 1000
legendConfig.MaxWidth <- 1000
legendConfig?labels <- labelConfig
plugins.Legend <- legendConfig
options.Plugins <- plugins
let lineDataSet = LineChartDataSet()
lineDataSet.Label <- "# of Votes"
lineDataSet.Data <- [|12;19;3;5;2;3|]
lineDataSet.BorderColor <- Union2Of2 bdColor
lineDataSet.BorderWidth <- 6
let lineData = ChartData()
lineData.Datasets <- [|lineDataSet|]
lineData.Labels <- [|"red";"blue";"yellow";"green";"purple";"orange"|]
let linearChart = ChartCreate(lineData, options)
let linear () = Chart("chartjs", linearChart)
linear() (Uses a canvas in the dom with the id of If you have a sample project/repo I can take a look at a specific example, but the above worked for me |
7.0.5.406-beta4 Now contains the fix for this available from our feed. |
Hi,
I was able to get what I want to see show up for legend config, but I tried change the font and font size, using labelConfig and set the legendConfig's labels properties to labelConfig, but then the legend would not show up after. Thanks!
let options = Options()
let plugins = Plugin()
let legendConfig = LegendConfig()
let font = Font()
font.Size <- 1000
let labelConfig = LabelConfig()
labelConfig.Font <- font
labelConfig.Color <- Union1Of2 1
labelConfig.BoxHeight <- 200
labelConfig.BoxWidth <- 200
labelConfig.Padding <- 30
labelConfig.UsePointStyle <- true
labelConfig.GenerateLabels
legendConfig.Display <- true
legendConfig.Position <- PositionString.Top
legendConfig.Align <- AlignString.Center
legendConfig.FullSize <- true
legendConfig.MaxHeight <- 1000
legendConfig.MaxWidth <- 1000
legendConfig.Labels <- [|labelConfig|] <<<<< legend doesn't show up after adding this.
plugins.Legend <- legendConfig
The text was updated successfully, but these errors were encountered: