Skip to content

Commit

Permalink
fix: don't sort in pie function
Browse files Browse the repository at this point in the history
  • Loading branch information
w33ble committed Dec 12, 2018
1 parent 4ccbabe commit c1c1627
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import keyBy from 'lodash.keyby';
import { get, map, groupBy, sortBy } from 'lodash';
import { get, map, groupBy } from 'lodash';
import { getColorsFromPalette } from '../../../common/lib/get_colors_from_palette';
import { getLegendConfig } from '../../../common/lib/get_legend_config';

Expand Down Expand Up @@ -67,10 +67,9 @@ export const pie = () => ({
},
},
fn: (context, args) => {
const rows = sortBy(context.rows, ['color', 'size']);
const seriesStyles = keyBy(args.seriesStyle || [], 'label') || {};

const data = map(groupBy(rows, 'color'), (series, label) => {
const data = map(groupBy(context.rows, 'color'), (series, label) => {
const item = {
label: label,
data: series.map(point => point.size || 1),
Expand All @@ -89,7 +88,7 @@ export const pie = () => ({
as: 'pie',
value: {
font: args.font,
data: sortBy(data, 'label'),
data,
options: {
canvas: false,
colors: getColorsFromPalette(args.palette, data.length),
Expand Down

0 comments on commit c1c1627

Please sign in to comment.