Skip to content
Open
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 lib/chart/axis.ex
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ defmodule Contex.Axis do
[
"<g ",
get_svg_axis_location(axis),
~s| fill="none" font-size="10" text-anchor="#{get_text_anchor(axis)}">|,
~s| fill="none" text-anchor="#{get_text_anchor(axis)}">|,
~s|<path class="exc-domain" stroke="#000" d="#{get_svg_axis_line(axis, range0, range1)}"></path>|,
get_svg_tickmarks(axis),
"</g>"
Expand Down
6 changes: 3 additions & 3 deletions lib/chart/plot.ex
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,11 @@ defmodule Contex.Plot do
plot_options =
Map.merge(
plot.plot_options,
Map.take(attributes_map, [:show_x_axis, :show_y_axis, :legend_setting])
Map.take(attributes_map, [:show_x_axis, :show_y_axis, :legend_setting, :default_style])
)

plot
|> Map.merge(
Map.take(attributes_map, [:title, :subtitle, :x_label, :y_label, :width, :height])
Map.take(attributes_map, [:title, :subtitle, :x_label, :y_label, :width, :height, :default_style])
)
|> Map.put(:plot_options, plot_options)
|> calculate_margins()
Expand Down Expand Up @@ -336,6 +335,7 @@ defmodule Contex.Plot do
subtitle: Keyword.get(attrs, :subtitle),
x_label: Keyword.get(attrs, :x_label),
y_label: Keyword.get(attrs, :y_label),
default_style: Keyword.get(attrs, :default_style),
plot_options:
Enum.into(Keyword.take(attrs, [:show_x_axis, :show_y_axis, :legend_setting]), %{})
}
Expand Down
2 changes: 1 addition & 1 deletion test/contex_plot_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ defmodule ContexPlotTest do

test "does not render styles if default turned off", %{plot: plot} do
refute plot
|> struct(default_style: false)
|> Plot.attributes(default_style: false)
|> Plot.to_svg()
|> elem(1)
|> IO.chardata_to_string()
Expand Down