%mandatory -->  dataSource;
%optional  -->  figureName , radius , groupsCol , xAxisCol , yAxisCol;

function dvpHist( dataSource , figureName , feature , numberofbins) 

if nargin < 1
    error('not enough parameters');
end
    
     if ~ischar(dataSource)
        
       if ~isnumeric(dataSource)
          error('invalid dataSoure!'); 
       end
    
     ctr = getappdata(0,'counter');
     dsName = strcat('dataSource ',int2str(ctr+1));
     setappdata(0,'counter',ctr+1);
    createDVPDataSource(dataSource,dsName); 
    
    else
        dsName = dataSource;
    end
    
    if ~exist('feature','var')|| ~ischar(feature) || isempty(feature)
    histFeature = 'mat-first-col';
    
else 
        histFeature = feature;
    end

if ~exist('figureName','var');
    
       ctr = getappdata(0,'counter');
    figName = strcat('Histogram',int2str(++ctr));
    
else
        figName = figureName;
end

if ~exist('numberofbins','var') || isempty(numberofbins) ||  ~isnumeric(numberofbins)
    Bins = 'default';
    
else
        Bins = numberofbins;
end


data = struct('requestType', 'create', 'operation', 'figure',...
    'config', struct('figureType', 'Histogram', 'id',figName,...
    'dataSourceID', dsName,...
    'figureProperties', struct('feature',histFeature , 'numberOfBins' , Bins)));

sendDataToDVP(data);

end