SWOT analysis
Strengths, weaknesses, opportunities and threats in four boxes. Good for a strategy meeting, a plan, a pitch.
The smallest code that works. change the code, then press Run
In your framework
import { Chart } from 'nervure/react';
const spec = {
type: 'swot',
strengths: ['Loyal customers', 'Fast delivery', 'Strong brand in the south'],
weaknesses: ['Small online shop', 'Few products for children'],
opportunities: ['Tourists in summer', 'New mall next year', 'Orders by phone'],
threats: ['Two new rivals', 'Rents going up', 'Higher price of flour'],
};
export default function Example() {
return <Chart spec={spec} style={{ height: 340 }} />;
}Or import this chart alone: what each import weighs.
Options
Beside the fields shared by every chart (title, format, heading, export…), type swot takes:
/** Strengths, weaknesses, opportunities and threats. */
interface SwotSpec extends Base {
type: 'swot';
strengths: string[];
weaknesses: string[];
opportunities: string[];
threats: string[];
/** Titles of the four boxes, in that order. */
labels?: [string, string, string, string];
}Style it
- Colours:
theme.palette,chart.setColor(name, colour), or--nervure-palettein your CSS. More - Marks:
[data-series="name"], parts:[data-part="axes"],legend,series. What you change is kept in exports. - Movement:
animation: falsedraws at once. More - Files:
chart.download('png'),svg,csv. More