<commit_before>
function chart(dynamic,yLabel,yMax,json_data1,json_data2,json_data3)
{
    var chartAttrs = {
        "width": '100%',
        "height": '80%'
    };
    
    var chartMargins = {
        right: 75
    };
    
    var willShowControls = false;
    var willHaveGuidelines = false;
    var willBeInteractive = false;
    var willUseVoronoi = false;
    
    if (dynamic == true)
    {
        willHaveGuidelines = true;
        willBeInteractive = true;
        willUseVoronoi = true;
    }

    function add_chart(json_data,chart_id)
    {
        d3.json(json_data, function (data) {
            nv.addGraph(function() {
                var chart = nv.models.stackedAreaChart()
                    .margin(chartMargins)
                    .x(function(d) { return d[0] })   //We can modify the data accessor functions...
                    .y(function(d) { return d[1] })   //...in case your data is formatted differently.
                    .yDomain([0, yMax])
                    .useInteractiveGuideline(willHaveGuidelines)    //Tooltips which show all data points. Very nice!
                    .rightAlignYAxis(true)      //Let's move the y-axis to the right side.
                    .transitionDuration(500)
                    .showControls(willShowControls)       //Allow user to choose 'Stacked', 'Stream', 'Expanded' mode.
                    .interactive(willBeInteractive)
                    .useVoronoi(willUseVoronoi)
                    .clipEdge(true);
                
                //Format x-axis labels with custom function.<commit_msg>Try to get D3 to work<commit_after>
function chart(dynamic,yLabel,yMax,json_data1,json_data2,json_data3)
{
    var chartAttrs = {
        "width": '100%',
        "height": '80%'
    };
    
    var chartMargins = {
        right: 75
    };
    
    var willShowControls = false;
    var willHaveGuidelines = false;
    var willBeInteractive = false;
    var willUseVoronoi = false;
    
    if (dynamic == true)
    {
        willHaveGuidelines = true;
        //willBeInteractive = true;
        //willUseVoronoi = true;
    }

    function add_chart(json_data,chart_id)
    {
        d3.json(json_data, function (data) {
            nv.addGraph(function() {
                var chart = nv.models.stackedAreaChart()
                    .margin(chartMargins)
                    .x(function(d) { return d[0] })   //We can modify the data accessor functions...
                    .y(function(d) { return d[1] })   //...in case your data is formatted differently.
                    .yDomain([0, yMax])
                    .useInteractiveGuideline(willHaveGuidelines)    //Tooltips which show all data points. Very nice!
                    .rightAlignYAxis(true)      //Let's move the y-axis to the right side.
                    .transitionDuration(500)
                    .showControls(willShowControls)       //Allow user to choose 'Stacked', 'Stream', 'Expanded' mode.
                    .interactive(willBeInteractive)
                    .useVoronoi(willUseVoronoi)
                    .clipEdge(true);
                
                //Format x-axis labels with custom function.
{'fraction_non_alphanumeric': 0.10031545741324921, 'fraction_numerical': 0.011041009463722398, 'mean_word_length': 1.6647058823529413, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1899764', 'n_tokens_mistral': 942, 'n_tokens_neox': 891, 'n_words': 210}