Muil

Muil

  • Docs
  • Configurations
  • API
  • Blog

›Components

Getting Started

  • Quick Start Guide
  • Slow Start Guide
  • Run Templates Viewer
  • Write Template
  • Styling Template
  • Solutions
  • Why Muil

Configurations

  • CLI
  • Custom Webpack Config
  • Custom Babel Config

API

  • Authorization
  • Sending Email
  • Generating PDF
  • Generating Image
  • Generating HTML

Email Limitations

  • Fonts
  • SVG

Components

  • Intro
  • Grid
  • Style
  • Alignment
  • Typography
  • Button
  • Callout
  • Menu
  • Spacer
  • Wrapper
  • Charts
  • PDF Page

Charts

Bar Chart

Single Value

Bar Chart

import {BarChart} from '@muil/components'

<BarChart
  height={200}
  legend={false}
  categories={[{ color: '#17a2b8' }]}
  series={[
    {
      label: '2017',
      value: 53,
    },
    {
      label: '2018',
      value: 13,
    },
    {
      label: '2019',
      value: 26,
    },
    {
      label: '2020',
      value: 43,
    },
  ]}
/>

Multiple Values

Multiple Bar Chart

import {BarChart} from '@muil/components'

<BarChart
  height={300}
  legend
  categories={[
    { label: 'One Week', color: '#17a2b8' },
    { label: '2 Weeks', color: '#d5d5d4' },
    { label: 'One Month', color: '#90ED7D' }
  ]}
  series={[
    {
      label: 'Rick & Morty',
      data: [53, 31, 25],
    },
    {
      label: 'BoJack Horseman',
      data: [13, 25, 94],
    },
    {
      label: '100 Humans',
      data: [26, 56, 37],
    },
  ]}
/>
PropertyTypeDescription
heightNumberheight of chart
classNameStringclass name
seriesArray of Objects {label: String, value: Number, data: Array(Number)}label under bar, value - for single percentage, data - for multiple percentages
categoriesArray of Objects {label: String, color: String}label for legend, color of bar
legendBooleanshow or hide legend

Horizontal Bar Chart

Single Value

Bar Chart

import {HorizontalBarChart} from '@muil/components'

<HorizontalBarChart
  maxWidth={400}
  legend={false}
  categories={[{ color: '#17a2b8' }]}
  series={[
    {
      label: '2017',
      value: 50,
    },
    {
      label: '2018',
      value: 30,
    },
    {
      label: '2019',
      value: 20,
    },
    {
      label: '2020',
      value: 2,
    },
  ]}
/>

Multiple Values

Multiple Bar Chart

import {HorizontalBarChart} from '@muil/components'

<HorizontalBarChart
  maxWidth={400}
  legend
  categories={[
    { label: 'One Week', color: '#17a2b8' },
    { label: '2 Weeks', color: '#d5d5d4' },
    { label: 'One Month', color: '#90ED7D' }
  ]}
  series={[
    {
      label: 'Rick & Morty',
      data: [53, 31, 25],
    },
    {
      label: 'BoJack Horseman',
      data: [13, 25, 94],
    },
    {
      label: '100 Humans',
      data: [26, 56, 37],
    },
  ]}
/>
PropertyTypeDescription
maxWidthNumbermax width of chart
classNameStringclass name
seriesArray of Objects {label: String, value: Number, data: Array(Number)}label under bar, value - for single percentage, data - for multiple percentages
categoriesArray of Objects {label: String, color: String}label for legend, color of bar
legendBooleanshow or hide legend

Calendar

Basic

Calendar

import {Calendar} from '@muil/components'

<Calendar showNumbers />

Heat map

Heat map

import {Calendar} from '@muil/components'

<Calendar
  monthsBefore={1}
  monthsAfter={1}
  dayClassName={({ day }) => `score${day % 4}`}
/>
PropertyTypeDescription
classNameStringclass name
monthsBeforeNumbernumber of months before current month
monthsAfterNumbernumber of months after current month
showNumbersBooleanshow or hide day numbers
dayClassNameFunction ({day: Number, date: Date})return class name for each day

Line Bar

Heat map

import {LineBar} from '@muil/components'

<LineBar
  percents={[
    { value: 10, color: '#17a2b8' },
    { value: 20, color: '#d5d5d4' },
    { value: 70, color: '#90ED7D' },
  ]}
/>
PropertyTypeDescription
classNameStringclass name
percentsArray of Objects {value: Number, color: String}value - percentage, color - color of bar
← WrapperPDF Page →
  • Bar Chart
    • Single Value
    • Multiple Values
  • Horizontal Bar Chart
    • Single Value
    • Multiple Values
  • Calendar
    • Basic
    • Heat map
  • Line Bar
Copyright © 2021 muil