Instead of transforming the data to a JSON string, just add it as a plain Javascript object:
var myPostData={'categoria':valor,'fluxo':fluxo};
$.ajax({
url:'data.php',
type:'post',
data:myPostData,
dataType: "json",
});
Also as pointed out in comments, you are accessing the POST variable by $_POST['valor']
, when you are sending it as $_POST['categoria']
.