Class: Shadcn::Chart::Preview

Inherits:
ApplicationViewComponentPreview show all
Defined in:
app/components/shadcn/chart/preview.rb

Instance Method Summary collapse

Instance Method Details

#areaObject

Upstream's "Area Chart".



40
41
42
# File 'app/components/shadcn/chart/preview.rb', line 40

def area
  render_with_template
end

#barObject

Upstream's "Bar Chart - Multiple", and the first shape here with an axis under it.



25
26
27
# File 'app/components/shadcn/chart/preview.rb', line 25

def bar
  render_with_template
end

#bar_stackedObject

Upstream's "Bar Chart - Stacked": one bar a month, split by device.



30
31
32
# File 'app/components/shadcn/chart/preview.rb', line 30

def bar_stacked
  render_with_template
end

#defaultObject

Upstream's "Pie Chart" example, drawn here rather than by recharts.



7
8
9
# File 'app/components/shadcn/chart/preview.rb', line 7

def default
  render_with_template
end

#donutObject

Upstream's "Pie Chart - Donut", and the shape most of its own examples use: inner_radius: is a fraction of the radius.



13
14
15
# File 'app/components/shadcn/chart/preview.rb', line 13

def donut
  render_with_template
end

#lineObject

Upstream's "Line Chart - Multiple".



35
36
37
# File 'app/components/shadcn/chart/preview.rb', line 35

def line
  render_with_template
end

#percentagesObject

What a pie is usually asked — how much of the whole — with the share in the tooltip instead of the count.



19
20
21
# File 'app/components/shadcn/chart/preview.rb', line 19

def percentages
  render_with_template
end