Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: flipChart
Type: Package
Title: Single function for calling charts - CChart
Version: 1.12.7
Version: 1.12.8
Author: Displayr <opensource@displayr.com>
Maintainer: Displayr <opensource@displayr.com>
Description: Wrapper for other chart functions, such that they can be access via a
Expand Down
3 changes: 2 additions & 1 deletion R/cchart.R
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,8 @@ getPPTSettings <- function(chart.type, args, data)
# Note that for Area, Bar, Column, Line the zero line of the values axis is shown by default
values.axis.line <- if (!isTRUE(args$categories.zero.line.width > 0)) list(width = args$values.line.width, color = args$values.line.color, crosses = "Minimum")
else list(width = args$categories.zero.line.width, color = args$categories.zero.line.color, dash = args$categories.zero.line.dash, crosses = "AutoZero")
categories.axis.line <- if (!isTRUE(args$values.zero.line.width > 0)) list(width = args$categories.line.width, color = args$categories.line.color, crosses = "Minimum")
default.cross <- if (isScatter(chart.type)) "Minimum" else "AutoZero"
categories.axis.line <- if (!isTRUE(args$values.zero.line.width > 0)) list(width = args$categories.line.width, color = args$categories.line.color, crosses = default.cross)
else list(width = args$values.zero.line.width, color = args$values.zero.line.color, dash = args$values.zero.line.dash, crosses = "AutoZero")

res$PrimaryAxis = list(LabelsFont = list(color = args$categories.tick.font.color,
Expand Down
8 changes: 7 additions & 1 deletion tests/testthat/test-chartsettings.R
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ test_that("Chart settings",
TitleFont = list(color = NULL, family = NULL, size = numeric(0)),
NumberFormat = "General",
AxisLine = list(Color = "#222222", Width = 1.50003750093752,
Style = "Solid"), Crosses = "Minimum", MajorGridLine = list(Color = "#BBBBBB",
Style = "Solid"), Crosses = "AutoZero", MajorGridLine = list(Color = "#BBBBBB",
Width = 0, Style = "None"), RotateLabels = TRUE, LabelPosition = "Low"))
expect_equal(attr(res, "ChartSettings")$ValueAxis, list(
LabelsFont = list(color = NULL, family = NULL, size = numeric(0)),
Expand Down Expand Up @@ -242,6 +242,12 @@ test_that("Chart settings",
append.data = TRUE)
expect_equal(attr(res, "ChartSettings")$PrimaryAxis$Crosses, "AutoZero")
expect_equal(attr(res, "ChartSettings")$ValueAxis$Crosses, "AutoZero")

res <- CChart("CombinedScatter", abs(dat.2d) + 10,
values.line.width = 2, categories.line.width = 2,
append.data = TRUE)
expect_equal(attr(res, "ChartSettings")$PrimaryAxis$Crosses, "Minimum")
expect_equal(attr(res, "ChartSettings")$ValueAxis$Crosses, "Minimum")
})

test_that("Scatter axes bounds",
Expand Down
Loading