Modulo:Graph/Configurazione

Versione del 3 ago 2015 alle 09:57 di Moroboshi (discussione | contributi) (aggiorno alla nuova versione con anche grafici a linea)

Configurazione del Modulo:Graph.


chart_config = {}

-- ===============================================================
-- Localization of parameter names
-- ===============================================================
chart_config.localization = {
    label = 'etichetta',
    thumb = 'allineamento',
    values = 'valori',
    color = 'colore',
    other = 'altri',
    ring = 'anello',
    name = 'nome',
    internal_legend = 'legenda',
    external_legend = 'legenda esterna',
    nCols = 'colonne legenda',
    other = 'altri',
    color_other = 'colore_altri',
    label_other = 'etichetta_altri',
    normalize = 'normalizza',
    debug_json = 'debug_json',

    basemap = 'mappa base',
    scale = 'scala',
    projection = 'proiezione',
    defaultValue = 'default',
    scaleType = 'tipo scala',
    domainMin = 'minimo dominio',
    domainMax = 'massimo dominio',
    colorScale = 'scala colori',
    width = 'larghezza',
    height = 'altezza',
    type = 'tipo',
    interpolate = 'interpolazione',
    symbols = 'simboli',
    symbolSize = 'dimensione simboli',

    -- Axes parameters
    xAxisTitle = 'titolo asse x',
    yAxisTitle = 'titolo asse y',
    xAxisMin = 'minimo asse x',
    xAxisMax = 'massimo asse x',
    yAxisMin = 'minimo asse y',
    yAxisMax = 'massimo asse y',
    xAxisFormat = 'formato asse x',
    yAxisFormat = 'formato asse y',
    xGrid = 'griglia asse x',
    yGrid = 'griglia asse y',
    xAxisPrimaryTicks = 'tacche asse x',
    yAxisPrimaryTicks = 'tacche asse y',
    xAxisPrimaryTicksNumber = 'n tacche asse x',
    yAxisPrimaryTicksNumber = 'n tacche asse y',
    xAxisSecondaryTicks = 'n tacche secondarie asse x',
    yAxisSecondaryTicks = 'n tacche secondarie asse y',

    yTitle = 'titolo y#',
    colors = 'colori',
    alpha = 'alfa',
    colorsByGroup = 'colori per gruppo x',
    strokeThickness = 'spessore linea',
    NoTracking = {'nocat'}
}

-- ===============================================================
-- List of interpolate options
-- ===============================================================
chart_config.interpolate = { monotone= true, linear= true, ['step-before']= true, ['step-after']= true,
                             basis= true, ['basis-open']= true, ['basis-closed']= true, bundle= true,
                             cardinal= true, ['cardinal-open']= true, ['cardinal-closed']= true }

-- ===============================================================
-- List of "yes" values
-- ===============================================================
chart_config.yes_values = { s=true, ['sì']=true, si=true, y=true, yes=true}

-- ===============================================================
-- List of "no" values
-- ===============================================================
chart_config.no_values = { n=true, no=true}

-- ===============================================================
-- List of symbols for mark on line chart
-- ===============================================================
chart_config.symbols = {square= true, cross=true, diamond=true, ['triangle-up']=true, ['triangle-down']=true}

-- ===============================================================
-- Localization of list and decimal point separator
-- ===============================================================
chart_config.separator = { decimal = "," , list = ";" }

-- ===============================================================
-- Localizzazione dei nomi dei parametri
-- Default colors from https://github.com/mbostock/d3/wiki/Ordinal-Scales#categorical-colors
-- include color specifications and designs developed by Cynthia Brewer (http://colorbrewer.org/)
-- ===============================================================
chart_config.colors_palette = {
    category10 = { 10, { '#1f77b4', '#ff7f0e', '#2ca02c', '#d62728', '#9467bd',
                         '#8c564b', '#e377c2', '#7f7f7f', '#bcbd22', '#17becf'}
                 },
    category20 = { 20, { '#1f77b4', '#aec7e8', '#ff7f0e', '#ffbb78', '#2ca02c',
                         '#98df8a', '#d62728', '#ff9896', '#9467bd', '#c5b0d5',
                         '#8c564b', '#c49c94', '#e377c2', '#f7b6d2', '#7f7f7f',
                         '#c7c7c7', '#bcbd22', '#dbdb8d', '#17becf', '#9edae5'}
                 },
    greenhue = { 7,    { '#c7e9c0', '#a1d99b', '#74c476', '#41ab5d', '#238b45',
                         '#006d2c', '#00441b'}
                },
    orangehue = {7,    { '#fdd0a2', '#fdae6b', '#fd8d3c', '#f16913', '#d94801',
                         '#a63603', '#7f2704'}
                }
    }

-- ===============================================================
-- Default values for chart
-- ===============================================================
chart_config.default = {
    width = 400,
    height = 200,
    width_piechart = 200,
    background_color = white,
    yGrid = true,
    xGrid = false,
    symbol = "square",
    symbol_size = 20,
    stroke_thickness = 2
}

-- ===============================================================
-- List of value for line graph
-- ===============================================================
chart_config.graph_type = {
    line = {"line", false},
    area = {"area", false},
    rect = {"rect", false},
    stackedline = {"line", true},
    stackedarea = {"area", true},
    stackedrect = {"rect", true},
    linea = {"line", false},
    istogramma = {"rect", false},
    ['linea cumulativa'] = {"line", true},
    ['area cumulativa'] = {"area", true},
    ['istogramma cumulativo'] = {"rect", true},
}

-- ===============================================================
-- Do no categorize for errors this namespace
-- ===============================================================
chart_config.uncategorized_namespaces = {
    Utente = true,
    Discussioni_utente = true,
    Discussione = true,
    Discussioni_modulo = true,
    Discussioni_template = true };

-- ===============================================================
-- Name of error category to use
-- ===============================================================
chart_config.errors_category = 'Errori di compilazione di un template grafico'

-- ===============================================================
-- List of errors messages
-- ===============================================================
chart_config.errors_key = {
    type_unknown = "Tipo di grafico %s non riconosciuto",
    value_not_valid = 'Valore per %s "%s" non valido',
    unknown_error = "Errore non riconosciuto"
}

return chart_config